XMLWordPrintable

Details

    • Feature Request
    • Resolution: Won't Do
    • Minor
    • None
    • EAP 5.1.0 Post Release
    • Other
    • None
    • NEW

    Description

      I would like to know if it's possible to add a feature to the jboss log4j implementation to add a specified prefix to each line of a stacktrace as described in the following link?

      http://stackoverflow.com/questions/3459089/is-it-possible-to-prefix-every-line-of-a-stacktrace-in-log4j
      (See the answer #2)

      This can be used on the syslog end to split logs by profile, application, etc...

      To implement it would require an additional property to be added to the SyslogAppender and a new version of the log4j ThrowableRenderer to add the prefix something like this:

      List<String> l = new LinkedList<String>();
      for (StackTraceElement ste: t.getStackTrace())
      {
      l.add("myPrefix " + ste.toString());
      }
      return (String[]) l.toArray();

      <appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
      <param name="Facility" value="LOCAL1"/>
      <param name="FacilityPrinting" value="false"/>
      <param name="SyslogHost" value="192.168.0.10"/>
      <param name="SyslogPrefix" value="myPrefix"/> <-- New property
      <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="jbossas_profile1: %-5p [%c] (%t) %m%n"/>
      </layout>
      </appender>

      Attachments

        Activity

          People

            huwang@redhat.com Hui Wang
            rhn-support-dboeren David Boeren
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: