Results 1 to 5 of 5

Thread: Logging ufw to a seperate logfile?

  1. #1
    Join Date
    Jan 2011
    Beans
    7

    Logging ufw to a seperate logfile?

    I tried: http://vincom2.wordpress.com/2010/04...erate-logfile/ but it's still flooding dmesg.

  2. #2
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Logging ufw to a seperate logfile?

    If you look at the file /etc/rsyslog.d/20-ufw.conf:
    Code:
    # Log kernel generated UFW log messages to file
    :msg,contains,"[UFW " /var/log/ufw.log
    
    # Uncomment the following to stop logging anything that matches the last rule.
    # Doing this will stop logging kernel generated UFW log messages to the file
    # normally containing kern.* messages (eg, /var/log/kern.log)
    #& ~
    ...you'll see that all the necessary info is already there. All you have to do is uncomment the last line (remove the #) and it will start logging to /var/log/ufw.

    The instructions you linked to are from 2010 and may have been relevant for an earlier version of Ubuntu.

  3. #3
    Join Date
    Jan 2011
    Beans
    7

    Re: Logging ufw to a seperate logfile?

    I have:

    # Log kernel generated UFW log messages to file
    :msg,contains,"[UFW " /var/log/ufw.log

    # Uncomment the following to stop logging anything that matches the last rule.
    # Doing this will stop logging kernel generated UFW log messages to the file
    # normally containing kern.* messages (eg, /var/log/kern.log)
    & ~

    It's still flooding dmesg.

  4. #4
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Logging ufw to a seperate logfile?

    I don't think you can remove them from the kernel ring buffer. Since these messages are generated by the kernel they will always be in the ring buffer. rsyslogd grabs these messages and copies them to the appropriate log file.

    If you want to not display them when running the dmesg command, you could try:
    Code:
    dmesg | grep -v UFW

  5. #5
    Join Date
    Jan 2011
    Beans
    7

    Re: Logging ufw to a seperate logfile?

    I filed a bug. This should not be happening.

    https://bugs.launchpad.net/ufw/+bug/1264621

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •