• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Wonder Loggin question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wonder Loggin question


  • Subject: Wonder Loggin question
  • From: Miguel Angel Torres Avila <email@hidden>
  • Date: Thu, 9 Jul 2009 12:37:26 -0500

Hi,

I am playing with Wonder because we are planning to migrate our applications in order to take advantage of all its features.
All of our application use log4j for loggin and we have an interface like this


Using this interface we can simply turn on /  off  Debug logs, stdout (For development) and we can change the application log's root path directory.
Once you click on "Aplicar" (Apply changes, not exit) or "Guardar" (Save changes and exit) we save changes on database and run a function that rebuild the log4j properties and load them.

Basically we have three appenders:

ErrorAppender, DebugAppender and stdout.

Error Appender is a file appender and just register erros.
DebugAppender is a DailyRollingFileAppender and it is included in the log4j properties if the logsDebugValue() funtion returns true.
stdout is a ConsoleAppender and it is set to register Debug logs only if logsDebugValue() funtion returns true otherwise it register INFO logs.

This is part of the code:
-------------------------------------------- CODE   ---------------------------------------------

String log4JRootLogger = "ErrorAppender";
if (logsDebugValue()) {
log4JRootLogger += ", DebugAppender";

}
if (logsStdoutValue()) {
log4JRootLogger += ", stdout";

}
properties.setProperty("log4j.rootLogger", log4JRootLogger);
// //////////////////////////////////////
if (logsDebugValue()) {
properties.setProperty("log4j.appender.DebugAppender","org.apache.log4j.DailyRollingFileAppender");
properties.setProperty("log4j.appender.DebugAppender.file", pathLogs + "appDebug.log");
properties.setProperty("log4j.appender.DebugAppender.datePattern", "'.'yyyy-MM-dd");
properties.setProperty("log4j.appender.DebugAppender.append","true");
properties.setProperty("log4j.appender.DebugAppender.layout","org.apache.log4j.PatternLayout");
properties.setProperty("log4j.appender.DebugAppender.layout.ConversionPattern","%-5p %d{dd-MMM-yyyy HH:mm:ss} [%t] - %m%n");
properties.setProperty("log4j.appender.DebugAppender.threshold","DEBUG");
}
if (logsStdoutValue()) {
properties.setProperty("log4j.appender.stdout","org.apache.log4j.ConsoleAppender");
properties.setProperty("log4j.appender.stdout.layout","org.apache.log4j.PatternLayout");
properties.setProperty("log4j.appender.stdout.layout.ConversionPattern","%-5p [%t] - %m%n");
if (logsDebugValue()) {
properties.setProperty("log4j.appender.stdout.threshold","DEBUG");
} else {
properties.setProperty("log4j.appender.stdout.threshold","INFO");
}

}
// ///////////////////////////////////////
properties.setProperty("log4j.appender.ErrorAppender","org.apache.log4j.FileAppender");
properties.setProperty("log4j.appender.ErrorAppender.file", pathLogs+ "appError.log");
properties.setProperty("log4j.appender.ErrorAppender.append", "true");
properties.setProperty("log4j.appender.ErrorAppender.layout","org.apache.log4j.PatternLayout");
properties.setProperty("log4j.appender.ErrorAppender.layout.ConversionPattern", "%-5p %d{dd-MMM-yyyy HH:mm:ss} [%t] - %m%n");
properties.setProperty("log4j.appender.ErrorAppender.threshold","ERROR");
if(logsDebugValue()){
properties.setProperty("log4j.logger.com.toracom.app", "DEBUG");
}
else{
properties.setProperty("log4j.logger.com.toracom.app", "INFO");
}
properties.setProperty("log4j.logger.org.apache", "WARN");


PropertyConfigurator.configure(properties);

-------------------------------------------- CODE  END  ---------------------------------------------
The problem is that once I prepare the application for working with Wonder.

http://wiki.objectstyle.org/confluence/display/WONDER/Integrate+Wonder+Into+an+Existing+Application

If we select the Debug and Stdout options we revive output logs like these:
DEBUG [WorkerThread4] - inserted WebObject with Name 'FileUpload1'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'ImageButton3'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'Conditional1'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'Image1'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'ImageButton1'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'TextField2'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'GenericContainer1'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'ComponentContent1'.
DEBUG [WorkerThread4] - inserted WebObject with Name 'Div1'.

One for each WOObject / WOComponent that is inserted in the main component that is being accessed. This makes difficult for reading our debug logs and it looks that it is affecting the response velocity of the application

I am not a log4j expert, does anybody know what can be happening?


By the way I set all logger in the Properties file to ERROR trying to find if there was the problem, but not, I was worng.

# Log4j Configuration
log4j.loggerFactory=er.extensions.logging.ERXLogger$Factory
log4j.rootCategory=INFO,A1
log4j.appender.A1=er.extensions.logging.ERXConsoleAppender
log4j.appender.A1.layout=er.extensions.logging.ERXPatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{MMM dd HH:mm:ss} %$[%#] %-5p %c %x - %m%n

# Log4j Categories
# Here are a few log4j sub-categories that are interesting.
# Don't forget that in developement mode this file will get reloaded
# everytime it changes, so if you say want to turn adaptor debugging
# on in the middle of the app simply set the below category to debug.
# Very handy.
# Base Category
log4j.logger.er=ERROR

# ERExtensions
# Transaction - Switching this to debug will start the sql ouputting.
log4j.logger.er.transaction.adaptor.EOAdaptorDebugEnabled=ERROR

# Fixes - Turning this on will show all the models that are loaded
log4j.logger.er.extensions.fixes.ERSharedEOLoader=ERROR

er.extensions.ERXNSLogLog4jBridge=ERROR
#log4j.logger.er.eo.ERXGenericRecord=DEBUG
#log4j.logger.er.validation.ERXEntityClassDescription=DEBUG
#log4j.logger.er.default.ERXEntityClassDescription=DEBUG
log4j.logger.er.extensions.ERXDatabaseContextDelegate=ERROR
log4j.logger.er.extensions.ERXConfigurationManager=ERROR
#log4j.logger.er.extensions.ERXApplication.RequestHandling=DEBUG




Ing. Miguel Angel Torres Avila




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Wonder Loggin question
      • From: "Ricardo J. Parada" <email@hidden>
  • Prev by Date: Listening for changes on an EO
  • Next by Date: Re: Wonder Loggin question
  • Previous by thread: Re: Listening for changes on an EO
  • Next by thread: Re: Wonder Loggin question
  • Index(es):
    • Date
    • Thread