• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero Blog

NameHero Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • VPS Hosting
    • WordPress Hosting
    • WooCommerce Hosting
  • Reseller
  • Enterprise
  • Domains
  • Account
  • Blog Home
  • Categories

How To Add Log Files To CSF

Bhagwad Park

Published on: November 29, 2021

Categories: VPS Hosting 1

The ConfigServer Security and Firewall plugin for your VPS does a better job at managing your server’s firewall than the default option. In addition to being more user-friendly, it has a bunch of useful features that I wouldn’t want to do without. One of the more useful features is the ability to monitor a long list of log files from a single drop-down box. By default, CSF comes with a few log files already listed, but you can add more. This tutorial will show you how to add log files to the CSF plugin.

CSF is a default plugin that comes with all NameHero Managed Cloud packages, so if you get a NameHero VPS, you won’t need to worry about installing or updating it.

Existing Log Files

The CSF dashboard allows you to monitor and search log files as shown here:

Monitor Log Files in CSF
Monitor Log Files in CSF

When you click “Watch System Logs”, you get a dropdown box where you can select the log files you want to monitor. These also helpfully refresh after a certain period that you can configure separately. You can also pause the refresh whenever you want. All told, it’s an amazingly useful tool that centralizes your log file management.

However, each installation is different, and it’s unlikely that the default CSF logs will contain everything you want. For example, my CSF configuration didn’t contain the Apache access files for my two domains:

Adding Extra Log Files to Monitor
Adding Extra Log Files to Monitor

The screenshot above shows the default logs with my two custom logs added above since I already added them in for this tutorial, and I don’t want to remove the entries just for the screenshot :). You can see that there are quite a few log files already included, but not the ones I wanted.

Adding New Log Files to CSF

To add new log files to this entry, you’ll have to SSH into your server. Unfortunately, there’s no graphical user interface that I could find where I could make the entries manually, so you have no choice but to use the command line. Moreover, these files are located in a privileged location, so you’ll need to either use sudo (recommended) or log in as root (not recommended). I’ve written a tutorial earlier on how to create a user with sudo privileges that you might find useful.

With the appropriate access, navigate to and open the following file:

/etc/csf/csf.syslogs

This is the default location for the file that contains the list of log files that CSF should monitor. The list is quite long, but most of them will be irrelevant to your installation. In this screenshot, I have Apache as my web server, so I add my two log files to the bottom of the list as shown here:

Adding the Lines to csf.syslogs

Just add them as ordinary lines in the text, save your changes, and exit.

Restart CSF

The next step is for CSF to notice your changes and incorporate them into your configuration. To do this, type the following command in the terminal – again with the right permissions:

csf -r

This will restart the CSF plugin and cause it to reload all the configuration files – including the ones you just added. The next time you access your CSF dashboard, you should be able to see the new log file entries, and you can monitor them like any other.

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Reader Interactions

Comments

  1. question asker says

    May 28, 2023 at 4:20 am

    What’s wrong with using CSF built in additional logs?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

Speed up your site: solving the WordPress slowdown

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • Website Performance
  • Web Hosting
  • Resellers
  • Website Development
  • Website Security
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Domains
Help & Support
  • NameHero Blog
  • Knowledgebase
  • Announcements
  • Affiliates
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 NameHero, LLC. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA