Automatically Saving & Emailing Client Logs on Error

I would like to be able to email the client logs to myself when something goes wrong, so I can easily debug the program. There are often cases when I am trying to trigger a very rare bug and I have to wait by a station for it to happen because I need the logs. I know I can change the log level, but I don’t want to dump this entire log for every station to the gateway, because it would be far too confusing to try to sift through it all and it would make debugging gateway-level problems more difficult.

Is there a way to programmatically save the client logs?

Following up, any help on this?

I don’t think so. The simplest approach is to have your users start the Vision Client in a terminal, using the full command line shown in the launcher log. Set the terminal to have a large scrollback buffer. The launcher itself spawns the real client then ends, so starting it in a terminal doesn’t help. Anyways, when the problems pops up, have the user exit and save the terminal contents.

Supposedly there are ways to manipulate the client’s log4j settings to log to a local file instead of (or along with) the console. Might want to look at log4j’s docs.