在Ubuntu中,我可以做这样的事情:
sudo echo something | logger -t logstuff
然后,我会在syslog( /var/log/messages
)中得到格式良好的消息。 在Debian Squeeze上,情况并非如此,上面的命令不会logging在那里。
如果我可以以普通用户的身份login,那也不错。
任何想法都欢迎。
它完全按照您在Debian Squeeze系统上的描述。
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
这是一个默认configuration,并且logger
是由一个低级别的Debian软件包提供的,所以它很有可能被安装( bsdutils )。 如果它不能在你的系统上运行,系统日志configuration( rsyslog
,无论你已经安装了什么)都可能/可能将警报发送到不同的文件。