4 Replies Latest reply on Jun 17, 2015 10:07 AM by srmudiganti

    Jboss AS 7.1.1 Custom logger - how to get line number and fileName

    ftom2 Newbie

      Hi,

       

      We recently upgraded Jboss version from 4.2.3 to 7.1.1. We had a custom log4j logger that writes log to an oracle DB. Once we upgraded we moved from log4j to Jboss default logging mechanism.

       

      So my hander now inherits from java.util.logging.Handler. Everything works fine except i can't seem to find a way to get the line number and fileName of the calling class.

       

      Before it was done like this:

       

      org.apache.log4j.spi.LocationInfo.LocationInfo locationInfo = new org.apache.log4j.spi.LocationInfoLocationInfo(event.getThrown(), event.getSourceClassName());.
      
      
      if (locationInfo != null) {
           fileName = locationInfo.getFileName();
           lineNumber = locationInfo.getLineNumber();
      }
      

       

       

      but this is a log4j functinality, how can i do it now?