nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
868 stars 265 forks source link

[IDEA] Ability to increase logging in ObjectXMLSerializer #6058

Open thorst opened 5 months ago

thorst commented 5 months ago

Is your feature request related to a problem? Please describe. I am getting the following error several times a day. It is at random time, and there is no clear cause. I've looked in the event log, there is nothing around these times. I contacted support, and they cannot troubleshoot any further because there is really no information to go off of.

ERROR 2023-10-24 09:04:02.758 [ServerLogServlet Thread (View Server Log) < qtp231198585-81512] com.mirth.connect.model.converters.ObjectXMLSerializer: com.mirth.connect.donkey.util.DonkeyElement$DonkeyElementException: java.lang.NullPointerException: Cannot invoke "String.length()" because "s" is null

Describe your use case I need this feature so we can troubleshoot the error. At this time, it isn't taking down mirth, but is it losing transaction? I don't know. I am trying to get a clean console, so we only see actionable items. We should see nothing normally, and when something is shown, we need to do some correction.

Describe the solution you'd like I am not sure of the specifics here, but we would enable or increase logging, either globally or specific to this file (below) and it would allow us to have more data on what is happening.

Support gave me this file: https://github.com/nextgenhealthcare/connect/blob/4.4.x/server/src/com/mirth/connect/model/converters/ObjectXMLSerializer.java

Describe alternatives you've considered This is not the only weird, undiagnosable error we are getting. I'd love to see an overhaul in the logging capabilities, where we can fine tune what we want, and what levels they are output as (error, warning, etc)

Additional context We are using Mirth 4.2.0 and do intend on upgrading in the upcoming months.

jonbartels commented 5 months ago

Is the log output you posted from the Mirth admin GUI or from mirth.log? mirth.log will often have a more complete stack trace.

Have you tried altering your log properties file to set a log level for com.mirth.connect.model.converters.ObjectXMLSerializer?

Edit conf/log4j2.properties to add a line: com.mirth.connect.model.converters.ObjectXMLSerializer = ALL and you should get much more log output.

This is a workaround. There are several catch blocks in the ObjectXMLSerializer code you linked which just catch and do not log anything.