Hi,
The new appender is
implemented and can be found in attachement as patch.
·
LevelRollingFileAppender’s
configuration
New appender extends
RollingFileAppender so it can be configured in the same way as normal
RollingFileAppender with one exception, value LevelToLog
has to be set. The difference in configuration file for this
appender looks as follows:
log4j.appender.test.rolling.file4=org.eclipse.corona.logger.log4j.appenders.LevelRollingFileAppender
log4j.appender.test.rolling.file4.File=C:\\Temp\\edka.test4.log
log4j.appender.test.rolling.file4.MaxFileSize=100KB
log4j.appender.test.rolling.file4.MaxBackupIndex=1
log4j.appender.test.rolling.file4.layout=org.apache.log4j.PatternLayout
log4j.appender.test.rolling.file4.layout.ConversionPattern=[%p] %m%n
log4j.appender.test.rolling.file4.LevelToLog=test#org.eclipse.corona.logger.log4j.levels.TestLevel
Bold line, indicates that file C:\\Temp\\edka.test4.log
will contain ONLY TestLevel logs.
- LevelRollingFileAppender
used with TestLevel:
If you want to use LevelRollingFileAppender to log TestLevel value, and you want to use it with other
appenders, following changes are required.
-
Defining
logger itself:
log4j.logger.org.eclipse.corona.project.container.explorer=test#org.eclipse.corona.logger.log4j.levels.TestLevel,
test.rolling.file3, eclipse.log, test.rolling.file4
-
If you
don’t want other appenders to log [TEST] level change, appenders configuration
as follows:
log4j.appender.test.rolling.file3=org.apache.log4j.RollingFileAppender
<Some other configuration stuff>
log4j.appender.test.rolling.file3.Threshold=DEBUG
The Threshold value
indicates that appender will log all values higher or equal to define Threshold
(in this case DEBUG).
This is more less all new stuff needed for
configuration.
Piotr.
From:
corona-dev-bounces@xxxxxxxxxxx [mailto:corona-dev-bounces@xxxxxxxxxxx] On Behalf Of Jaworowski, Piotr
Sent: Tuesday, September 19, 2006
3:37 PM
To: Corona development
Subject: RE: [corona-dev] List of
Logging Tasks
Actually, I think that TestLevel should
have the lowest level of all possible.
If we set its level to higher than FATAL,
than all TestLevel messages will be logged into corona log files, even if
we’ll set the rootLogger like
log4j.rootLogger=FATAL, console
To achieve the result wanted by Glenn, we
can add new log4j appender (extend DailyRollingFileAppender?) which would
filter out all messages with other level than TestLevel.
What do you think about this?
Piotr.
From:
corona-dev-bounces@xxxxxxxxxxx [mailto:corona-dev-bounces@xxxxxxxxxxx] On Behalf Of Kalka, Edyta
Sent: Tuesday, September 19, 2006
3:00 PM
To: Corona development
Subject: RE: [corona-dev] List of
Logging Tasks
Patch commited with one change –
TestLevel has not the lowest level but the greatest – higher than FATAL.
If we set TestLevel to TRACE level we
would have logs delivered from all levels beginning from the lowest.
Configuration inside log4j.properties (as
Piotr mentioned):
In case of rootLogger:
log4j.rootLogger=test#org.eclipse.corona.logger.log4j.levels.TestLevel,
console
In case of other loggers:
log4j.logger.org.eclipse.corona.test= test#org.eclipse.corona.logger.log4j.levels.TestLevel,
console, test.rolling.file2
Log call using CoronaLogService:
Activator.getCoronaLogService().log(CoronaLogService.LOG_TEST,
“log service for tests enabled”);
Edyta
From: Jaworowski,
Piotr
Sent: 18 września 2006 17:17
To: Everitt, Glenn; Kalka, Edyta
Cc: O'Flynn, Dennis; Hawkins, Joel; Wright, Jim;
Okraszewski, Marcin; Kaczmarek, Pawel
Subject: RE: [corona-dev] List of
Logging Tasks
Hi,
As an attachment you can find a patch for the org.apache.log4j_1.2.13 plugin.
The patch contains an implementation of TestLevel class.
Short tutorial, how to use custom test
level.
1) log4j.properties file has to be enhanced with new TestLevel like:
log4j.rootLogger=INFO, console ß old line which says that INFO level should be displayed
log4j.rootLogger=test#org.eclipse.corona.logger.log4j.levels.TestLevel,
console ß new version of line which says that new test level should be used.
2) To log something with TestLevel use following line:
logger.log(TestLevel.TEST, "This line will be logged");
3) To test whether TestLevel is enabled, use:
If
(logger.isEnabledFor(TestLevel.TEST)) {
// log test here.
}
P.s. Here comes a funny question. The
question is what should be the level of test level? Should the TestLevel be
equivalent to TRACE or to FATAL? Currently, the TestLevel is the lowest level.
Cheers,
Piotr
From: Everitt, Glenn
Sent: Monday, September 18, 2006
2:29 PM
To: Kalka,
Edyta
Cc: O'Flynn, Dennis; Hawkins, Joel; Wright, Jim;
Jaworowski, Piotr; Okraszewski, Marcin;
Kaczmarek, Pawel
Subject: RE: [corona-dev] List of
Logging Tasks
See my comments on
your comments on my comments below.
From: Kalka, Edyta
Sent: Monday, September 18, 2006
4:16 AM
To: Everitt, Glenn
Cc: O'Flynn, Dennis; Hawkins, Joel; Wright, Jim;
Jaworowski, Piotr; Okraszewski, Marcin;
Kaczmarek, Pawel
Subject: RE: [corona-dev] List of
Logging Tasks
From: Everitt, Glenn
Sent: 15 września 2006 20:31
To: Kalka,
Edyta
Cc: O'Flynn, Dennis; Hawkins, Joel; Wright, Jim;
Jaworowski, Piotr; Okraszewski, Marcin;
Kaczmarek, Pawel
Subject: RE: [corona-dev] List of
Logging Tasks
Edyta:
Could we have Piotr determine how to have
EcorePlugin logging output put into the same log files used by the
CoronaLogService?
Yes. I suppose adding new ILogListener
could be a solution here.
Good, does it make
sense for Piotr to work on this?
Could we also have Piotr determine how to
have output from Corona
test classes written to a log specifically for test output?
Adding new appender and
‘org.eclipse.corona.test‘ logger wouldn’t be enough?
What I wanted was a
way to put only output specific to test results to log file. It seems
like we need another log level like TEST to the existing Levels of ERROR,
WARNING, INFO, DEBUG. How hard would that be?
Edyta
I know you did a great deal of work on the
logging but, we need a task for Piotr that can be easily written as a
patch. It seems that the fewer files involved in a patch the better.
You, Dennis and I will continue will the
adding logging statements. After the first pass at logging statements then
you and I will do the package renaming. Next everyone will do more
javadoc.
From: Kalka, Edyta
Sent: Friday, September 15, 2006
7:24 AM
To: Everitt, Glenn
Cc: O'Flynn,
Dennis; Hawkins, Joel;
Wright, Jim; Jaworowski,
Piotr; Okraszewski, Marcin;
Kaczmarek, Pawel
Subject: RE: [corona-dev] List of
Logging Tasks
Glenn,
I have questions concerning adding
headers, cleaning logging etc.
How are we going to split work here?
Should I start from the beginning of list
and add: missing headers (event if I’m not the author of the class), log
service initialization to activators not using it etc.?
Edyta
From: corona-dev-bounces@xxxxxxxxxxx [mailto:corona-dev-bounces@xxxxxxxxxxx] On Behalf Of Kalka,
Edyta
Sent: 15 września 2006 12:07
To: Corona
development
Subject: RE: [corona-dev] List of
Logging Tasks
In case of EMF/SDO generated code such
sample log call can be found: EcorePlugin.INSTANCE.log(exception) – which wraps log call on
org.eclipse.core.runtime.ILog.
Edyta
From: corona-dev-bounces@xxxxxxxxxxx [mailto:corona-dev-bounces@xxxxxxxxxxx] On Behalf Of Everitt, Glenn
Sent: 14 września 2006 20:59
To: Corona
development
Subject: [corona-dev] List of
Logging Tasks
I went through all of the plugins that I believe are used and
looked to see if the CoronaLogService was being used by looking in the
plugin’s Activator. If I found the CoronaLogService being
instantiated I checked to see if it was consistently used. I don’t
know how to use the CoronaLogService in plugins without Activators. We
have some plugins that are used as libraries, but I think they still have
behavior that needs logged. We need to figure this part out. I
think we may want to use a different Logging Service for our test
plugins. Currently none of the test plugins are doing any logging just
System.out…
The conclusion is we have some work to do. What I
found is below we should clean logging up before we change any more package
names because I don’t want to grind through all of the plugins and
create this list again
org.eclipse.corona – CoronaLogService found but needs
work
org.eclipse.corona.client.collaboration.event –
missing
org.eclipse.corona.client.collaboration.ui – missing
org.eclipse.corona.client.ecf – CoronaLogService found
org.eclipse.corona.client.project.builder – found
org.eclipse.corona.client.project.event – missing
org.eclipse.corona.client.project.ui – missing
org.eclipse.corona.common.collaboration –
CoronaLogService found
org.eclipse.corona.common.ecf – no Activator –
how do we access the Logger service
org.eclipse.corona.common.project – CoronaLogService
found but not used
org.eclipse.corona.container.manager –
CoronaLogService found but needs more work
org.eclipse.corona.model.container – missing but
generated code, find out if EMF/SDO has another log / debug approach, no
Activator
org.eclipse.corona.model.container.edit - missing but
generated code, find out if EMF/SDO has another log / debug approach, no
Activator
org.eclipse.corona.model.container.editor - missing but
generated code, find out if EMF/SDO has another log / debug approach, no
Activator
org.eclipse.corona.model.container.project - missing but
generated code, find out if EMF/SDO has another log / debug approach, no
Activator
org.eclipse.corona.container.project.edit - missing but
generated code, find out if EMF/SDO has another log / debug approach, no
Activator
org.eclipse.corona.container.project.editor - missing but
generated code, find out if EMF/SDO has another log / debug approach, no
Activator
org.eclipse.corona.project.container.explorer – found
but not used in package org.eclipse.corona.project.container.explorer.actions
or views
org.eclipse.corona.project.container.view –
CoronaLogService found but needs some work
org.eclipse.corona.repository – CoronaLogService found
not bad
org.eclipse.corona.repository.adapter.team – no
Activator – how do we access the Logger service
org.eclipse.corona.repository.adapter.wp –
CoronaLogService found but not used
org.eclipse.corona.repository.dbms.team –
CoronaLogService found but not used
org.eclipse.corona.server.derby – CoronaLogService
found
org.eclipse.corona.server.ecf – CoronaLogService found
org.eclipse.corona.server.repository.team –
CoronaLogService found
org.eclipse.corona.server.test.container.project – not
found, this is a test class does it make sense to log to CoronaLogService or a
TestLogService?
org.eclipse.corona.test – not found, this is a test
class does it make sense to log to CoronaLogService or a TestLogService?
org.eclipse.corona.test.server.ecf – not found, this
is a test class does it make sense to log to CoronaLogService or a
TestLogService?
org.eclipse.corona.ui.tools – missing
test.eclipse.corona – not found, this is a test class
does it make sense to log to CoronaLogService or a TestLogService?
test.eclipse.corona.common.project – not found, this
is a test class does it make sense to log to CoronaLogService or a
TestLogService?
test.eclipse.corona.repository – not found, this is a
test class does it make sense to log to CoronaLogService or a TestLogService?
The contents of this e-mail are intended for the named addressee only.
It contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose it
to anyone else. If you received it in error please notify us immediately and
then destroy it.
The contents of this e-mail are intended for the named addressee only.
It contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose it
to anyone else. If you received it in error please notify us immediately and
then destroy it.
The contents of this e-mail are intended for the named addressee only.
It contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose it
to anyone else. If you received it in error please notify us immediately and
then destroy it.
The contents of this e-mail are intended for the named addressee only.
It contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose it
to anyone else. If you received it in error please notify us immediately and
then destroy it.
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.