如果我使用记录器进行日志记录,如下所示:
/bin/logger "hello world"我可以看穿我的日志线:
journalctl --since "-1m"
Oct 08 09:12:17 myhomepc duda[11670]: hello world但是,我可以使用的默认伪单位文件是什么呢?
journalctl -u "duda" --since "-1m" 什么都不回。
发布于 2019-10-08 15:22:06
journalctl -t duda --since "-1m"应该能工作。
logger接口到syslog(3)系统日志模块,并在系统日志中使用其SYSLOG_IDENTIFIER (-id)创建条目,参见man 记录器(1)。
journalctl允许过滤指定的SYSLOG_IDENTIFIER,每个man 日志(1)
-t, --identifier=SYSLOG_IDENTIFIER|PATTERN
Show messages for the specified syslog identifier SYSLOG_IDENTIFIER, or for any of the messages with a
"SYSLOG_IDENTIFIER" matched by PATTERN.https://unix.stackexchange.com/questions/545656
复制相似问题