You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
16:40:01,170 |-ERROR in com.eclecticlogic.whisper.logback.WhisperAppender[whisper] - Appender [whisper] failed to append. java.lang.NullPointerException
at java.lang.NullPointerException
at at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
at at com.eclecticlogic.whisper.core.WhisperManager.log(WhisperManager.java:82)
at at com.eclecticlogic.whisper.logback.WhisperAppender.append(WhisperAppender.java:90)
at at com.eclecticlogic.whisper.logback.WhisperAppender.append(WhisperAppender.java:37)
I back tracked that to the original error message (logged by the File Appender):
While you can make a good argument that it is poor form to provide a null message, it does not cause problems for Logback's File Appender or SMTP Appender. Even if the WhisperAppender didn't throw an NPE, it would cause problems for the digest if I have multiple different "errors" being logged with a null message.
So, my question/bug/concern is two fold:
Is there a better way to handle this then throwing an NPE when the message is null?
Is there a better way to recognize duplicate messages that have null messages?
I can fix my code, of course, but it is easy enough for another null message to creep back in at a later date (old programming habits can die hard), which could cause us to miss important error messages.
This may or may not be a bug, but I couldn't find anywhere else to raise the question, so my apologies if this was the wrong spot.
The text was updated successfully, but these errors were encountered:
Logging null is an application error but Whisper should handle it. For now I've modified the code to treat null as a string "null" for the log message. Please upgrade to 1.0.4. I just pushed 1.0.4 out so Maven Central's index may not have it. But if you simply change the version string in your pom, maven/gradle etc. should pull it.
I ran into the following NullPointerException:
I back tracked that to the original error message (logged by the File Appender):
Which came from this code in my application:
While you can make a good argument that it is poor form to provide a null message, it does not cause problems for Logback's File Appender or SMTP Appender. Even if the WhisperAppender didn't throw an NPE, it would cause problems for the digest if I have multiple different "errors" being logged with a null message.
So, my question/bug/concern is two fold:
I can fix my code, of course, but it is easy enough for another null message to creep back in at a later date (old programming habits can die hard), which could cause us to miss important error messages.
This may or may not be a bug, but I couldn't find anywhere else to raise the question, so my apologies if this was the wrong spot.
The text was updated successfully, but these errors were encountered: