1

Please look in to the picture,here am trying to open(with vi editor) my server console log file(around 100MB) and it takes more than two minutes to open with so many special characters.after deleting the first line (means typing "dd")then i can easily view the file and size of the file is also reduced very much.My server OS is RHEL 5.4 and jboss is running in to it.

Please help me to avoid such junk characters coming to my server console log files and it helps me to save my valuable space in server.

alt text

2
  • What console log are we talking about?
    – Déjà vu
    Jan 15, 2011 at 11:33
  • Those are nulls. Any idea what's writing them to your log? That's pretty weird. Jan 15, 2011 at 15:03

2 Answers 2

1

simplest way would be filter non-printable chars, like that

cat console.log |perl -pe 's/[^[:print:]\n]//gi' > cleared_log.file

or just

perl -pe 's/[^[:print:]\n]//gi' console.log

But best way would be to figure out why u have such a junk in that log file

0

In VI, a ^@ represents a NULL (ASCII value 0) character. Googling for appears to suggest this is a known issue with JBoss and Logrotate. Check this website for some insight and a suggested fix:

http://efreedom.com/Question/2-71341/JBoss-Logrotate-Create-Log-Files-Full-NUL-Characters

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .