Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Logger to a file other that /var/log/system.log

    Scheduled Pinned Locked Moved Development
    3 Posts 2 Posters 2.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      francisT
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • F
        francisT
        last edited by

        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
        
        
        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          (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
          

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.