1753435 Members
4719 Online
108794 Solutions
New Discussion юеВ

Syslog messages

 
Tony  LeBlanc
Occasional Contributor

Syslog messages

I have an appication that logged some info in syslog, how would I go about removing this information from the syslog. This may be trivial, but do I just vi the file and remove the lines?

Tony
3 REPLIES 3
Andreas Voss
Honored Contributor

Re: Syslog messages

Hi,

trivial answer:
yes you can edit syslog.log and save it back but this does not prevent your application to write into syslog further.

Regards
Kofi ARTHIABAH
Honored Contributor

Re: Syslog messages

Tony:

grep -v "unique string" /var/log/adm/syslog/syslog.log > /var/adm/syslog/syslog.log.new ; mv /var/adm/syslog/syslog.log /var/adm/syslog/syslog.old ; mv /var/adm/syslog/syslog.log.new /var/adm/syslog/syslog.log

where unique string is the string that identifies the lines of your application uniquely.

then if your application's debug level is listed as part of /etc/syslog.conf, you would have to disable it accordingly.
nothing wrong with me that a few lines of code cannot fix!
Rick Garland
Honored Contributor

Re: Syslog messages

Removing entries from the syslog file itself is not a first choice.
Start by modifying the /etc/syslog.conf file to prevent the messages from going in there.