0

I am running syslog-ng on debian.

How do I check which conf file was loaded upon startup?

Neither

systemctl status syslog-ng

nor

systemctl show syslog-ng

tell me.

2 Answers 2

1

By default, syslog-ng loads the configuration from a hard-coded default configuration path (you can check that path with the syslog-ng --help command, it's next to the --cfgfile option.

This can be changed via the command line with the mentioned option.

If you want to see all the configuration files loaded recursively (@include), you can run syslog-ng in debug mode:

$ syslog-ng -Fed

Starting to read include file; filename='/usr/share/syslog-ng/include/scl/sudo/sudo.conf', depth='2'
...

If you want to see the full preprocessed configuration of a running syslog-ng instance, you can query it with the sbin/syslog-ng-ctl config --preprocessed command.

If you want to ensure that the correct version of the configuration is running in syslog-ng (there might be a newer config on the disk that hasn't been applied yet), you can use the following command:

sbin/syslog-ng-ctl config --verify
Configuration file matches active configuration

You can also get a hash or identifier for similar purposes:

sbin/syslog-ng-ctl config --id
1
  • Btw, the original author and the top contributors of syslog-ng have created a hard fork: AxoSyslog. Take a look if you're interested in new features, improvements, packages, container images, etc.: axoflow.com/axosyslog-syslog-ng-fork
    – MrAnno
    Commented Jun 4 at 12:04
1

try syslog-ng-ctl config That should display the currently used configuration (I'm not sure if it displays where it was loaded from) https://axoflow.com/docs/axosyslog-core/app-man-syslog-ng/syslog-ng-ctl.1/#displaying-the-configuration

1
  • /usr/sbin/syslog-ng-ctl config - apparently not in my path. As you mentioned, it doesn't appear to tell me which file it was loaded from. There is also /usr/sbin/syslog-ng-ctl list-files, but for me it returns No files available, even though there is a loaded configuration. Strange...
    – skeetastax
    Commented May 31 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .