Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2379

Is the LoggerConfig name and parent blank for a new logger?

    XMLWordPrintableJSON

Details

    • Question
    • Status: Reopened
    • Major
    • Resolution: Unresolved
    • 2.11.0
    • None
    • Core
    • None
    • Important

    Description

      This is the code snippet, From the output, notice that loggerConfig name is blank and its parent is null. Is this how it is supposed to be?

      String loggerName = "com.myCompany.myClass";
      static Logger logger = LogManager.getLogger(loggerName);
      LoggerConfig loggerConfig = LoggerContext.getContext(false).getConfiguration().getLoggerConfig(loggerName);
      System.out.println("new loggerConfig name: " + loggerConfig.getName());
      System.out.println("new loggerConfig parent : " + loggerConfig.getParent());

      Output:
      new loggerConfig name:
      new loggerConfig parent : null

      Attachments

        Activity

          People

            Unassigned Unassigned
            Ranjit.Dsouza Ranjit Dsouza
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: