Fixed: Excessive Logging in Console/VNC Due to CSF

Helposoft Staff

Administrator
Staff member
Points
178

Issue:

When using the console or VNC to access your server, you might encounter excessive logging output, such as messages about blocked ports or other firewall activities. This can make it difficult to read and interact with the console effectively. This issue is often caused by the logging verbosity of ConfigServer Security & Firewall (CSF).

Solution: Reduce Console Log Verbosity

To address this issue, you can use the dmesg command to adjust the verbosity level of kernel messages that are displayed in the console. This will help in reducing the amount of logging information that appears and make it easier to interact with your server.

Steps to Fix the Issue:

  1. Access Your Server
    Log in to your server using SSH or through the console/VNC where you are experiencing the issue.
  2. Run the dmesg Command
    Execute the following command to set the kernel message log level to a less verbose setting:

    Code:
    sudo dmesg -n 1
    • dmesg is a command used to display kernel-related messages.
    • The -n option specifies the log level. Setting it to 1 will limit the output to only the most critical messages.
  3. Verify the Change
    After running the command, check if the excessive logging in the console or VNC has been reduced. You should now see only critical messages, which makes it easier to interact with the console.
  4. Make the Change Persistent (Optional)
    If you want to make this change persistent across reboots, you will need to configure it in the system startup scripts or configuration files. Here's a way to do it using sysctl:
    • Edit the Sysctl Configuration File:
      Open the sysctl configuration file with a text editor:

      Code:
      sudo nano /etc/sysctl.conf

    • Add the Following Line:
      Add this line to set the kernel message logging level at boot:

      Code:
      kernel.printk = 1 4 1 3
      • The 1 at the beginning corresponds to the console log level.
    • Apply the Changes:
      Apply the changes immediately without rebooting:

      Code:
      sudo sysctl -p
  5. Monitor Logging
    After making these changes, monitor the console and VNC to ensure that the logging behavior is as expected. You should see a reduction in the verbosity of the logs.

Additional Tips:

  • Review CSF Logging Configuration:
    Although the above steps address console verbosity, you might also want to review the CSF logging settings to ensure it is configured according to your needs. You can adjust the logging settings in /etc/csf/csf.conf if necessary.
  • Regularly Check Log Files:
    Keep an eye on log files such as /var/log/csf.log and /var/log/lfd.log to ensure that logging does not become excessive in these files.

Conclusion:

By adjusting the kernel message logging level using the dmesg -n 1 command and optionally making this change persistent, you can reduce the excessive logging in your server’s console or VNC. This approach helps in making the console output more manageable and improves your ability to interact with the server.

For further details, consult the dmesg documentation or seek support from your server management tools' documentation.
 
Top