LoggingContext JNDI not working in Session EJB using Thread

Hi everybody: I'm starting using logback, and I have a strange behauvour of logback. 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("Hola"); 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 in the EJB Session everything is correct. Even if I get the MDC objet when thread is executing, all the values I put in servlet are there; but the context is default, so it never uses my logback.xml!!!!. I don't know if it is a logback bug, or if I'm doing something wrong I don't know if I've explained myself correctly, sorry my english is poor Thanks a lot

Hello, I have a TimeBasedRollingPolicy maxhistory of 90 days. Although my logs are rolling daily, the old files beyond my max history are not deleted. Max history is not working. <fileNamePattern>MyLog-%d{yyyy-MM-dd}.log</fileNamePattern> <MaxHistory>90</MaxHistory> version I'm using logback-0.9.13 sl4j-api-1.5.6 thanks in advance

hi group, I tried this on our non-prod environment with smaller Max history of 5 and the old files were deleted. I'm just wondering if this is because the max history number before is too big? ________________________________ From: Jenny <jenny_uy81@yahoo.com> To: logback-user@qos.ch Sent: Thu, December 10, 2009 10:31:10 AM Subject: [logback-user] MaxHistory not deleting old files Hello, I have a TimeBasedRollingPolicy maxhistory of 90 days. Although my logs are rolling daily, the old files beyond my max history are not deleted. Max history is not working. <fileNamePattern>MyLog-%d{yyyy-MM-dd}.log</fileNamePattern> <MaxHistory>90</MaxHistory> version I'm using logback-0.9.13 sl4j-api-1.5.6 thanks in advance

hi group, I just did some tests and when MaxHistory is more than 30 days, log rotation in not working, If its less than that, logs are rotated properly. Could this be a bug? I only tried in logback-0.9.13 ________________________________ From: Jenny <jenny_uy81@yahoo.com> To: logback users list <logback-user@qos.ch> Sent: Tue, January 5, 2010 4:18:34 PM Subject: Re: [logback-user] MaxHistory not deleting old files hi group, I tried this on our non-prod environment with smaller Max history of 5 and the old files were deleted. I'm just wondering if this is because the max history number before is too big? ________________________________ From: Jenny <jenny_uy81@yahoo.com> To: logback-user@qos.ch Sent: Thu, December 10, 2009 10:31:10 AM Subject: [logback-user] MaxHistory not deleting old files Hello, I have a TimeBasedRollingPolicy maxhistory of 90 days. Although my logs are rolling daily, the old files beyond my max history are not deleted. Max history is not working. <fileNamePattern>MyLog-%d{yyyy-MM-dd}.log</fileNamePattern> <MaxHistory>90</MaxHistory> version I'm using logback-0.9.13 sl4j-api-1.5.6 thanks in advance
participants (2)
-
Jenny
-
miguel goyena