Wrapper Log/ Log Level INFO

We are using solarwind to monitor the log file located in the installation folder ignition/logs/wrapper.

Unfortunately, regardless of the level that is configured for each log in the scripts (Ex. logger.error('this is an error') , the wrapper log will only show the level as INFO.

We noticed that the level of the log gets included in the message with the initial only (Ex. E this is an error). However, the actual field for the level is still showing INFO.

I looked at the Tanuki Software manual for the Java Service wrapper and got the idea to attempt the below changes in the config file.

I modified the config file to display only logs that are WARN or above, but no luck. Instead the logs stops displaying any new entries as its trying to filter out all the INFO logs. I did restart the gateway after every config file change was done.

# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=WARN

I also tried using the system.util.setLoggingLevel(loggerName, loggerLevel) to attempt to modify the log level for an existing logger and no luck either.

Finally, I tried to change the log levels at the gateway (Status/Logs / click the edit icon and list all the logs and modify each one manually.) No luck.

I tried this both in 8.1 and 8.3 and had the same result.

As a last instance, I was thinking of changing the format of the log by changing the below config to only display the message and try to find a way to only look at the first character of each entry (I=Info,W=warn,E=error).

Is there a way to make ignition log the correct level in the log level field rather than logging everything as info?

# Format of output for the console. (See docs for formats)
wrapper.console.format=M

Tried setting wrapper.logfile.format=M in ignition.conf?

1 Like

No, because the wrapper is simply logging the stdout of the java process--it doesn't interpret the text from stdout at all. Any entries in the wrapper log that aren't INFO come from the wrapper itself.

You need to play with the logback.xml configuration file.

I did try it. THanks for the response.

This is how you would change the single letter levels used by the Ignition portion of the logs to something else.

1 Like

Thank you Mr Turmel. Ill research this option.

I am not trying to change the single letters. My goal is to display the log levels, including Warn,Error, and Fatal. Right now everything is logged as INFO.

Make the change I suggested to get rid of the service wrapper's own log levels and you'll be left with only the Ignition log levels.

Changes to ignition.conf won't be seen until you restart the Ignition Gateway.

I tried that. I do get the Initial of the log level type but its part of the message. By doing this I am hidding the log level and only displaying the message.

The "Message" from the service wrapper is actually the entire logging statement from Ignition, with its own level, timestamp, message, etc...

The log level is that single letter. If you want it formatted differently you need to modify logback.xml.

Thank you both for the help.

Do you have a sample code on how the xml file should look like to make it work that way?

Somewhere in that file there should be a pattern like this:

<pattern>%.-1p [%-30c{1}] [%d{HH:mm:ss.SSS}] [%t]: %m %X%n)</pattern>

change it to:

<pattern>%p [%-30c{1}] [%d{HH:mm:ss.SSS}] [%t]: %m %X%n)</pattern>

see Chapter 6: Layouts

1 Like

Thank you. It still only showing as part of the message but I think its getting me somewhere.

I could not make it show in the level field. Right now i am just using the M in the config file.

I would skip the wrapper.log entirely.

Configure logback to write to a separate file entirely in whatever format you choose.

This post has some possible inspiration: