Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-497

LoggingContextSelect JNDI No context creating threads in a EJB

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • Application (EJB jar, WAR) deployed in JBOSS 5.0.1

    Description

      I'm using LoggingContextSelect JNDI.

      My application es an ear deployed in JBOSS, with three WAR and a EJB
      session jar.

      One of the servlet in a WAR uses the Sesssion EJB. In the EJB Session
      Method I create a Thread, and start it

      MandarMensajes threadException = new MandarMensajes(tipo,cuantos,cadaCuanto);
      threadException.start();

      In this thread the run method uses logback for logging.

      Logger logger = LoggerFactory.getLogger(this);
      logger.logDebug("Hello");

      But the logger I get have a default context!!!!!!, not the context defined
      in the JNDI.

      Only happends this when a use the thread in the Session EJB.
      If I use the MandarMensajes thread in the servlet everything is correct.
      If I get a logger anywhere else in the EJB Session everything is correct.
      If I use the run() method of ManderMensajes in the EJB Session everything is correct.
      Even if I get the MDC objet when thread is executing, all the values I put in servletare there; b
      ut the context is default, so it never uses my logback-Application.xml config file!!!!.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            mgoyena Miguel Goyena
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: