How to reset gateway logs without restarting?

Hi All
Can you please share a way to reset gateway logs or is restart necessary?
i would like to speedup my debugging process and up to now i was using wrapper logs and kept clearing them.
Is there a way to filter loggers to show only my loggers in the gateway logs?
I guess good practice is to following some naming convention e.g. logger name matches module name.
Is anybody using writing logs to separate files (as mentioned in other questions)?
I believe there is more to life then just debugging my code :slight_smile:

Give your logger a meaningful name, log at the appropriate level.

Then you can set up the filtering to show only the logs you want/need to see.

1 Like

do you know how to delete the logger - is restart necessary? i cannot see any delete option for self created logger?

You cannot delete a logger. Restart your gateway.

1 Like

obviously both wrapper file and gateway logger have its use but what surprised is that the message in the logger (automatic ignition logger) in the first line of its content was more helpful to debug my code then wrapper logs. Should they not have the same content?

i am probably missing something - looks like my wrapper file is now crippled logging only my logger entries even thou i reset gateway logs to the default.

The wrapper is capturing the java process's stdout and stderr pipes, adding a configurable prefix and writing it out. The format of java logs going to java's stdout is configurable in logback. Java's stdout will also get any print statements in gateway scope (those bypass java's log system) and the output of any DLL/so to the process pipes.

So, different.

2 Likes

There are similarities and have some overlap, but not the same. The webpage log is polled from the internal database I believe. You can download that by hitting download logs in the top right of that log web page. It can be useful if looking through longer time frames or for specific logs.

Wrapper log has some level of information from the events while Ignition runs, but also logs startup issues and things before Ignition is fully started.

2 Likes

i think i upset wrapper file by setting gateway logs to my logger because after resetting
to default levels the wrapper still shows my own logger.
I am on ignition 8.1.21
If this require restart and this not possible it would put me off from using loggers and filtering...

Your custom logger is still logging, even if you hide it from the gateway's log page.
If you don't want things to appear in the wrapper.log, stop logging.

3 Likes

That might be the misconception here. The values in the webUI for logging aren't actually disabling your logging. It is just hiding it from the interface. Events still get logged regardless of what your settings are on that page.

i reset gateway logs to default
then i found my logger and set it to OFF
and wrapper file is still upset and does not show me java jiberish which i am missing :slight_smile:

I have no idea how that happened.

I generally do not filter in the gateway's logging UI (well, practically never), so I've not seen this behavior.

I use lots of loggers (usually one per script, using project name and script name), and log at .debug() level for most everything.

I then set loggers of interest to DEBUG level while using tail --follow on the wrapper log. For this to work well, the Ignition gateway should not be generating many logs at INFO level or higher. (I consider excess logging to be a system bug, in itself.) In a pinch, I'll pass the output of tail to grep.

I don't like that the gateway web gui doesn't honor line breaks in log entries--they are fundamentally text--nor its paging behavior, so I don't use it much.

3 Likes

That was my point: turning it off on the gateway's log page only HIDE your logging there, it doesn't STOP it.
Go and change the actual logging in the designer.

2 Likes

thanks for highlighting it
i did miss one line where my logger was used and when i removed it
Java jibberish is back - i am happy :slight_smile:

Would you please help me to understand 2 things ?

If understood correctly you keep loggers permanently in your code - lets say 1 logger per script.
Then if needed you would go to gateway logging page and set specific logger to debug which would start printing the output for analysis in the wrapper file and you use linux tools for that. All good so far.
1 If i am not mistaken - once you have loggers in your code then java jibberish will be excluded from the wrapper ? even restart of gateway will not help to restore java jibberish as loggers are in the code permanently? if that is true - are you not missing java logging?
2 in your opinion would sending logs to windows event logger be a good idea? it is managed then by operating system itself and there are various options i guess.

  1. No, nothing missing from my logs. (What do you mean by "java jibberish" ?)

  2. Blegh. Of course, I avoid Windows like the plague (because it is), and I don't recommend deploying Ignition on it.

2 Likes
  1. No, nothing missing from my logs. (What do you mean by "java jibberish" ?)

it is java logging which takes most of the space if issue occurs
When i had logger set up it filtered the java logging

Blegh. Of course, I avoid Windows like the plague (because it is), and I don't recommend deploying Ignition on it.

I used ubuntu a little bit and i quite liked it. Any chance to highlight the main reasons for avoiding windows - i am sure there are a few.

I highly doubt that.
Were your loggers in except blocks ?

1 Like

no just standard code flow - i will need to repeat it later to keep my sanity :slight_smile: