-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
documentationPull requests or issues that affect documentationPull requests or issues that affect documentation
Description
The Log4j 2 API documentation page could be improved to state that:
- parameterized logging and string concatenation should not be mixed, e.g.:
// This is discouraged, but fine: logger.info("Hello " + name + "!"); // This is recommended: logger.info("My name is {}.", myName); // Mixing the two approaches: a recipe for pattern specifier injection: // E.g. if name contains '{}'. logger.info("Hello " + name + "! My name is {}.", myName);
- we could replace the usage of
LogManager.getFormatterLogger(Class)
withLogManager.getLogger(Class, MessageFormatter)
, which is more generic.
vy, raboof, Chealer and tamton-aquib
Metadata
Metadata
Labels
documentationPull requests or issues that affect documentationPull requests or issues that affect documentation