Log4j 2
  1. Log4j 2
  2. LOG4J2-631

Update docs to clarify how to use formatter logger and standard logger together

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-rc1
    • Fix Version/s: 2.0
    • Component/s: Documentation
    • Labels:
      None

      Description

      public class Example {
      
      	private final static Logger FORMATTER_LOGGER = LogManager.getFormatterLogger(Example.class);
      
      	private final static Logger LOGGER = LogManager.getLogger(Example.class);
      
      	public static void main(String[] args) {
      		LOGGER.log(ERROR, "{} happened", "Something");
      		FORMATTER_LOGGER.log(ERROR, "%s happened", "Something");
      	}
      }
      
      13:40:35.401 [main] ERROR com.example.Example - {} happened
      13:40:35.404 [main] ERROR com.example.Example - Something happened
      

      After inverting the two constant declarations:

      13:41:13.730 [main] ERROR com.example.Example - Something happened
      13:41:13.732 [main] ERROR com.example.Example - %s happened
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Remko Popma
            Reporter:
            Alexandre Gattiker
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development