====== Linux syslog ====== * [[https://system-monitoring.readthedocs.io/en/latest/log.html|로그 (syslog) — System monitoring 0.1 documentation]] * [[https://man7.org/linux/man-pages/man1/logger.1.html|logger(1) - Linux manual page]] ===== 기본 옵션 ===== * ''-i'' : logger PID 출력 * ''-t'' / ''%%--tag=문자열%%'' : 기본값은 실행하는 username. 태그를 통해서 로그에 일관된 prefix 를 붙일 수 있다. ===== shell 에서 syslog 출력 ===== * [[https://man7.org/linux/man-pages/man1/logger.1.html|logger(1) - Linux manual page]] * [[https://linuxhint.com/use-logger-command-linux/|How to Use Linux Logger Command]] * [[https://www.networkworld.com/article/3274570/using-logger-on-linux.html|How to use logger on Linux | Network World]] logger -i -t "[작업명]" "메시지" # /var/log/syslog 파일을 보면 메시지가 남는다. Dec 14 16:10:59 kwon37xi-tpx1 kwon37xi: 메시지