I want to log from my nxlog.conf to my LogFile.

Example: nxlog.conf:

include additonal/*.conf


Log DEBUG "module.conf included"

How can i do this?

AskedJuly 21, 2020 - 3:36pm

Answer (1)


I'm not sure what you'd like to achieve. `nxlog.conf` is the main config file, where you define sources of your logs, the way of handling them, and targets where logs should be forwarded.

I recommend spending a while on analyzing the documentation (I assume you're interested in the community edition): https://nxlog.co/docs/nxlog-ce/nxlog-reference-manual.html. You can find many examples of configs there - I believe that's the best starting point.

Once you find what's interesting for you - solving any issues would much more feasible.

Best of luck!

Comments (3)

  • framold's picture

    I want nxlog to log, when it parses the config file. I want it to log, that it found the correct include file. This is helpful when you include with wildcards.

  • raf's picture

    Sure, nxlog is a perfect solution when it comes to logging!

    However, we'd need to know what kind of logs and from which sources you want to collect, as well as what would be the expected destination.

    Especially in terms of wildcards, it would be good to know which operating system do you use?

    Could you share your conf files and tell more about the context of your log collection?



  • framold's picture


    include <abs_path_to_additional>/*.conf


    <Input tcp>
        Module  im_tcp
        Port    1514
        Exec    parse_syslog_bsd();
    <Output file>
        Module  om_file
        File    "tmp/output_" + $Hostname + "_" + month(now())
            if file->file_size() > 15M
                $newfile = "tmp/output_" + $Hostname + "_" +
                            strftime(now(), "%Y%m%d%H%M%S");
                exec_async("/bin/bzip2", $newfile);
    <Route route1>
        Path    tcp => file

    I have no way of knowing if route1is loaded if nothing is logged per tcp. I want nxlog to print into its internal log (not the om_file), that it successfully included route1.conf.