log file of agents processing issue

View: New views
2 Messages — Rating Filter:   Alert me  

log file of agents processing issue

by Gopal Varshney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I am using JADE-LEAP 3.6.1 and logging some processing of three agents M Agent, O Agent and L Agent with the help of log4j API in a single log file agents.log.

I configured logger to generate backup files of log file every hour.

----------------------------------------------------

Log4j.properties file:-

 

log4j.rootLogger=DEBUG, stdout, agents

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%d %p [%C{1}][%M] --> %m\n

log4j.appender.agents=org.apache.log4j.DailyRollingFileAppender

log4j.appender.agents.layout=org.apache.log4j.PatternLayout

log4j.appender.agents.DatePattern=.yyyy-MM-dd-HH

log4j.appender.agents.layout.ConversionPattern=%d %p [%C{1}][%M] --> %m\n

log4j.appender.agents.File=${user.dir}/logs/agents.log

------------------------------------------------------

 

in all agents classes I am creating logger as

 

public class MAgent extends Agent{

 

            private Logger log =  org.apache.log4j.Logger.getLogger(MAgent.class.getName());

            @Override

            protected void setup() {

                        // -------------Some processing of MAgent ----------------//

 

                        log.debug("Agent " + this.getLocalName() + " is started.");

                        addBehaviour(new MAgentBehaviour(this));

            }

}

------------------------

In the same way we did logging in other agents also.

 

Problem :: agants.log file is overwritten every hour and no back up file is generated, meaning old log written in agants.log file is cleared and logging starts at the beginning of the file.

And all three agents show the ERROR message on console as “log4j:ERROR Failed to rename [location/logs/agents.log]\location/logs/agents.log.2009-10-28-14].”

 

Is their any specific way to log the agents processing?

Please suggest.

 

Thanks

Gopal

 

 

 

 

 

 

 

 

 

 

 


_______________________________________________
jade-develop mailing list
jade-develop@...
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm

RE: log file of agents processing issue

by Caire Giovanni-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I’m not an expert of Log4j, but certainly there is nothing in JADE that can affect the way Log4j manages log files à I’m pretty sure that the problem depends on some wrong Log4j configuration.

 

Bye,

 

Giovanni

 


From: jade-develop-bounces@... [mailto:jade-develop-bounces@...] On Behalf Of Gopal Varshney
Sent: giovedì 29 ottobre 2009 8.42
To: jade-develop@...
Subject: [jade-develop] log file of agents processing issue

 

Hi,

 

I am using JADE-LEAP 3.6.1 and logging some processing of three agents M Agent, O Agent and L Agent with the help of log4j API in a single log file agents.log.

I configured logger to generate backup files of log file every hour.

----------------------------------------------------

Log4j.properties file:-

 

log4j.rootLogger=DEBUG, stdout, agents

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%d %p [%C{1}][%M] --> %m\n

log4j.appender.agents=org.apache.log4j.DailyRollingFileAppender

log4j.appender.agents.layout=org.apache.log4j.PatternLayout

log4j.appender.agents.DatePattern=.yyyy-MM-dd-HH

log4j.appender.agents.layout.ConversionPattern=%d %p [%C{1}][%M] --> %m\n

log4j.appender.agents.File=${user.dir}/logs/agents.log

------------------------------------------------------

 

in all agents classes I am creating logger as

 

public class MAgent extends Agent{

 

            private Logger log =  org.apache.log4j.Logger.getLogger(MAgent.class.getName());

            @Override

            protected void setup() {

                        // -------------Some processing of MAgent ----------------//

 

                        log.debug("Agent " + this.getLocalName() + " is started.");

                        addBehaviour(new MAgentBehaviour(this));

            }

}

------------------------

In the same way we did logging in other agents also.

 

Problem :: agants.log file is overwritten every hour and no back up file is generated, meaning old log written in agants.log file is cleared and logging starts at the beginning of the file.

And all three agents show the ERROR message on console as “log4j:ERROR Failed to rename [location/logs/agents.log]\location/logs/agents.log.2009-10-28-14].”

 

Is their any specific way to log the agents processing?

Please suggest.

 

Thanks

Gopal

 

 

 

 

 

 

 

 

 

 

 


_______________________________________________
jade-develop mailing list
jade-develop@...
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm