Skip to content

Creating extra Log files for RT components

Hi,

Is it possible to create an extra logfile using a C++ RT component? I would like to for instance redirect all error log messages into a other file than Output.log.

Kind regards,
Michael

Comments

  • Hello Michael,

    you can have a look at the "/etc/plcnext/Device.log.ini" File

    you could add there another RollingFileAppender for your needs.

    just add the Threshold=ERROR,

    This will not remove the errors from the Output.log but you will have a seperate files with only errors and above.

    kind regards,
    Oliver

  • Hi Oliver,

    Thanks for your reply. So coming back to my question there is no way to programmatically create a new log file during the runtime and redirect the logs to it?

    Michael

  • Hi everyone,

    I am still looking into the option to have a separate logfile for my output (my requirement is to have all product's errors logged into a separate file [excluding the PLCnext outputs]) So far, I have managed to locate the header files for the log4cplus, but I am struggling to find a library/binary that I could link with my C++ library.

    Has anyone tried and succeeded to have the log4cplus running in their own solution?

    Kind regards,
    Michael

  • Hello Michael,

    sorry for the delay.
    Like you guessed you will have to use the /usr/lib/liblog4cplus-2.0.so.3 library and use log4cplus directly.

    Currently the PLCnext logging mechanism does not support adding seperate Logfiles during the programm construction.
    We are now evaluating this as possible future feature.

    kind regards,
    Oliver.

Sign In or Register to comment.