Description
(see here for some details )
At the moment it is not possible to log stuff like this:
log.info("${date:now:buhu}");
("ERROR Invalid date format: "now:yyyyMMdd-HHmmss", using default java.lang.IllegalArgumentException: Illegal pattern character 'n'")
Because log4j2 tries to change the logged output - want to substitute a date. This is intransparently limiting the logging.
nobody knows what kind of strings are allowed and what kind of strings will be interpreted by log4j2. But it becomes worse if you use slf4j and switch the logger implementation to log4j2 - it could happen that just switching breaks your code.
This is a real issue if you use libraries like Apache Camel because camel itself uses strings like
${date:now:YYYY...}
to substitute stuff like file names. see http://camel.apache.org/simple.html
At the moment camel is logging this stuff on debug (sometime i need it to see if i correctly set up camel) so it is no production issue here. But what about other libraries or the future?
The only way i see is a switch to disable all kinds of lookups and it should probably off by default.
Attachments
Issue Links
- Blocked
-
LOG4J2-2109 Add property to disable message pattern converter lookups
- Closed
- is required by
-
LOG4J2-1552 Help Apache Camel project to upgrade from Log4j 1.x to 2.x
- Open
-
LOG4J2-1502 CsvParameterLayout and CsvLogEventLayout insert NUL character if data starts with {, (, [ or "
- Resolved