You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Rémi C. (Jira)" <ji...@apache.org> on 2019/11/15 15:09:00 UTC

[jira] [Updated] (LOG4J2-2721) Thread crash when parameter is a null value for StringMapMessage

     [ https://issues.apache.org/jira/browse/LOG4J2-2721?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rémi C. updated LOG4J2-2721:
----------------------------
    Description: 
 

{{logger.info(markerCLM, new StringMapMessage()
 .with("message", "Test message")
 .with("event.action", null)
 .with("event.category", "General"));}}

This will crash. It is not supposed to happen, but sometimes a parameter can be null unexpectedly.

 

MapMessage should be "null safe".

 

[https://github.com/apache/logging-log4j2/blob/master/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java]

line 732

  was:
 

{{logger.info(markerCLM, new StringMapMessage()
			.with("message", "Test message")
			.with("event.action", null)
			.with("event.category", "General"));}}

This will crash. It is not supposed to happen, but sometimes a parameter can be null unexpectedly.

 

StringMapMessage should be "null safe".


> Thread crash when parameter is a null value for StringMapMessage
> ----------------------------------------------------------------
>
>                 Key: LOG4J2-2721
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2721
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.12.1
>            Reporter: Rémi C.
>            Priority: Major
>   Original Estimate: 4m
>  Remaining Estimate: 4m
>
>  
> {{logger.info(markerCLM, new StringMapMessage()
>  .with("message", "Test message")
>  .with("event.action", null)
>  .with("event.category", "General"));}}
> This will crash. It is not supposed to happen, but sometimes a parameter can be null unexpectedly.
>  
> MapMessage should be "null safe".
>  
> [https://github.com/apache/logging-log4j2/blob/master/log4j-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java]
> line 732



--
This message was sent by Atlassian Jira
(v8.3.4#803005)