Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In Ubuntu I could do something like:

sudo echo something | logger -t logstuff

Then I would get well formatted message in syslog (/var/log/messages). On Debian Squeeze that isn't the case, the above command would not log there.

It would also be nice if I could log as normal user there...

Any ideas are welcome.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

It does exactly as you describe on my Debian Squeeze system.

root@neo:~# echo something | logger -t logstuff
root@neo:~# cd /var/log
root@neo:/var/log# tail -f messages
Jun 20 07:12:53 neo kernel: 1264 pages in swap cache
Jun 20 07:12:53 neo kernel: Swap cache stats: add 246940, delete 245676, find 95246080/95251764
Jun 20 07:12:53 neo kernel: Free swap  = 254264kB
Jun 20 07:12:53 neo kernel: Total swap = 262140kB
Jun 20 07:12:53 neo kernel: 131071 pages RAM
Jun 20 07:12:53 neo kernel: 0 pages HighMem
Jun 20 07:12:53 neo kernel: 2707 pages reserved
Jun 20 07:12:53 neo kernel: 35457 pages shared
Jun 20 07:12:53 neo kernel: 77069 pages non-shared
Jun 20 10:22:26 neo logstuff: something

root@neo:/var/log# cat /etc/debian_version
6.0.5

This is a default config, and logger is provided by one of the low level Debian packages, so there's a good chance it's installed (bsdutils). If it doesn't work on your system, it's possible / likely that the syslog configuration (rsyslog, whatever you have installed) is sending the alerts to a different file.

share|improve this answer
    
NVM, it seems that on my machine, the /etc/rsyslog.conf has been modified. –  Veseliq Jun 20 '12 at 11:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.