Logger to a file other that /var/log/system.log
-
I've looked in the documentation and failed to find an answer to this, if I'm blind please point me to where my google-fu failed. Likewise if its somewhere on these boards.
I'd like to log certain messages to a different file than the standard system.log. Specifically I want to occasionally put a line in /var/log/filter.log so that I can tell when I last looked at it. I tried the naive
logger -f /var/log/filter.log "message"which would work on quite a few BSD & Linux systems but in pfsense 2.0 the -f parameter appears to be ignored and the message is written to system.log no matter what.
Any assistance much appreciated
Francis
-
OK someone figured this out for me. For others that may be interested the trick is to figure out which syslog facilities/priorities go to the right log file.
I want filter.log and local0.* goes there so
: logger -p local0.info "this is my test message" : clog /var/log/filter.log | tail -1 Dec 12 05:13:09 pfSense root: this is my test message -
(I was working up a reply, and you responded before I could hit submit… but there is still something I can add:
You can also control the tag, or get a message in from another command like so:
echo Hello World | logger -t mytag -p local0.info
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginPrivacy Policy · Cookie Policy