3 Replies Latest reply on Jul 23, 2012 3:21 PM by lukas lukasz

    Configure org.jboss.logging

    lukas lukasz Newbie

      Hello

       

      previously when i use jboss 4 i use log4j so i configure my logging properties like that:

       

      private static Logger logger = Logger.getLogger(Main.class.getName());
      
      and i used properties configuration: 
      
      common.log4j.ClasspathPropertyConfigurator.configureWithClasspathResource('path to properties file');
      

       

      so i have got question its posible to have got multiple confituration using org.jboss.logging ???

       

      because sometimes i like to use console but sometimes file configuration for my logging ....

       

      can i use external configuration file and jboss.logging ?? e.g i have got configuration log file for class main in folder /home/mark/logMain.properties ??

       

      thx for reply

        • 1. Re: Configure org.jboss.logging
          lukas lukasz Newbie

          So what i need

          i need to have got my org.jboss.logging configuration in my project not in standalone.xml

          such like i have got configuration my database connection in *-ds.xml file so i need sonething like that : example : * - log.xml and in this file i have got configuration for jboss logging ... (not in standalone.xml by in my own project file)

          can i do that ?

          • 2. Re: Configure org.jboss.logging
            James Perkins Master

            If you're using log4j in your application you can use a log4j.xml configuration file to configure your loggers and handlers (appenders). On version 7.2.x* or EAP 6 all you need to do is include the configuration. In earlier versions you would need to exclude the servers version of log4j and include your own within your application.

             

            If you're not using log4j then you can include a logging.properties file in AS 7.2.x* or EAP 6 in your application. That would create a new logging context and configure your loggers and handlers according the logging.properties file.

             

            It's not yet implemented, but what also might be of interest to you in the future are logging profiles. The concept here is you would create logging profiles and assign that profile to your application via a deployment descriptor.

             

            --

            James R. Perkins

             

             

            * There is no release of 7.2.x, but you can build from source

            1 of 1 people found this helpful
            • 3. Re: Configure org.jboss.logging
              lukas lukasz Newbie

              But i wrote my app on openshift and there is Jboss 7.1.0 Thunder as i know

               

              I am using log4j but i use jboss logging and its very interesting so i decide to use it in my project ....but as i say i need to have got configuration file in my project its not a big problem for me i am waiting for logging profiles

               

              thx for replies