0 Replies Latest reply on Sep 17, 2002 3:42 AM by Stefan Faist

    Save logfile in JBOSS_HOME/server/all/log

    Stefan Faist Newbie

      I have a EJB and use log4j to log what this Bean do, like log when the methode ejbCreate() is called or something like that.

      But the logfile is save in the JBOSS_HOME/bin directory.

      How can I save the logfile in the JBOSS_HOME/server/all/log directory or in antoher server instance log directory?

      The fallowing show how I set the properties for log4j:

      static Logger logger = Logger.getLogger(ProductBean.class.getName());

      ...

      Properties props = new Properties();
      props.setProperty("log4j.rootLogger", "debug, R");

      props.setProperty("log4j.appender.R", "org.apache.log4j.RollingFileAppender");
      props.setProperty("log4j.appender.R.File", "ProductBean.log");

      props.setProperty("log4j.appender.R.layout", "org.apache.log4j.PatternLayout");
      props.setProperty("log4j.appender.R.layout.ConversionPattern", "%d %-5p [%t] %-17c{2} (%13F:%L) %3x - %m%n");

      PropertyConfigurator.configure(props);
      logger.info("ejbCreate(): " + product);

      I use Jboss 3.0.2
      Can somebody help me?

      Regards
      STEFAN