Question : how to use logger in Linux.

There is a unitility called logger. I would like to use it. I want to log the info: "The process is starting."
logger -t BACKUP -f //tmp//backup.log message The process is starting.
No error message shown up in screen or in backup.log, but no infomation was logged in either. How

Answer : how to use logger in Linux.


logger doesn't work the way you think it does.   It's an interface to the SYSLOG system logger

the [-f fname] flag   takes each line from fname  and puts it in SYSLOG (may be /var/log/syslog on your machine)

if there is a message provided, the [-f fname] option appears to be ignored

So, in /var/log/syslog  you probably have lines of the form

date host BACKUP: message The process is starting.

Random Solutions  
 
programming4us programming4us