Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2840

Expose server name as a System property so it can be used in log4j messages

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Trivial
    • 4.1.1
    • 4.1
    • None
    • None

    Description

      Sometimes is useful to have the server name in log4j log messages. In the default log4j configuration we already use the ${server} variable (snippet from log4j.xml):

      <param name="ConversionPattern" value="[$\{server}] %-5p %d\{dd.MM.yyyy HH:mm:ss} %c %F(%M:%L) - %m%n" />
      <param name="Header" value="%n
      ===================================%n
      Magnolia%n
      Version: $\{pom.version}%n
      Server: $\{server}%n
      Url: %X\{requesturi}%n
      Userid: %X\{userid}%n
      Number of occurrences: %o%n
      ===================================%n
      " />
      

      "pom.version" is replaced by maven, "requesturi" and "userid" are set by a filter, but "server" needs to be set as a system property in order to work. It's safe to set it since it can't differ also if more webapps are running on the same jvm.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                fgiust Fabrizio Giustina
                fgiust Fabrizio Giustina
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD