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

        Alexandre Gattiker created issue -
        Remko Popma made changes -
        Field Original Value New Value
        Summary Cannot use formatter logger and standard logger with same name Update docs to clarify how to use formatter logger and standard logger together
        Assignee Remko Popma [ remkop@yahoo.com ]
        Fix Version/s 2.0 [ 12324757 ]
        Component/s Documentation [ 12312247 ]
        Remko Popma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Remko Popma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development