Reply to comment

Log Everything: Send Shell Commands to Syslog

This is an article on security, but I started to record all my commands to syslog so I can track what I'm doing, when, and for how long, more or less. Then I record this on my calendar to see if I'm staying focused on work, or getting distracted. It's a nice blog post.

Bash History to Syslog

Edit: so I implemented it on my computer, but changed it slightly:

# log all my commands
function log2syslog
{
     declare command
     command=$(fc -ln -0)
     logger -p local1.notice -t log_everything $USER "$command"
}
trap log2syslog DEBUG

Reply

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options

15 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.