Re: Logging problems
The same can be achieved by setting DEBUG to INFO in log4j.logger.org.apache.geronimo.gbean.runtime.GBeanSingleReference=DEBUG. It was nice to be able to just add one line to debug a class, and not hunt down the threshold to change it... Though I agree that for a release the threshold should be set to INFO. Thanks Anita --- Dain Sundstrom <[EMAIL PROTECTED]> wrote: > The log level is set to INFO: > > http://svn.apache.org/repos/asf/geronimo/server/trunk/assemblies/ > geronimo-boilerplate-minimal/src/main/resources/var/log/server- > log4j.properties > > -dain > > On Nov 10, 2006, at 6:33 PM, anita kulshreshtha wrote: > > >The log file only contains environment info. No other > > information is > > being written. > > > > Thanks > > Anita > > > > > > > > > > > __ > > > __ > > Cheap talk? > > Check out Yahoo! Messenger's low PC-to-Phone call rates. > > http://voice.yahoo.com > > Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com
Re: Logging problems
The log level is set to INFO: http://svn.apache.org/repos/asf/geronimo/server/trunk/assemblies/ geronimo-boilerplate-minimal/src/main/resources/var/log/server- log4j.properties -dain On Nov 10, 2006, at 6:33 PM, anita kulshreshtha wrote: The log file only contains environment info. No other information is being written. Thanks Anita __ __ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com
Logging problems
The log file only contains environment info. No other information is being written. Thanks Anita Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com
Logging problems encountered
I have been experiencing some problems with the geronimo.log file losing data. I tracked it down to be a combination of me customising server-log4j.properties so that log4j.appender.FILE.append=false was specified, and an EJB application that uses log4j. I have included my observations below for future reference and comment. 1) Geronimo is started. The static initialisation in the Daemon class causes a console logger to be set up. 2) org.apache.geronimo.system.logging.log4j.Log4jService.doStart() is called that: a) starts a timer that will be schedules every 60 seconds for checking changes to the server-log4j.properties file. b) calls org.apache.geronimo.system.logging.log4j.Log4jService.reconfigure() which causes the server-log4j.properties to be read and the geronimo.log file to be opened. 3) An EJB that is loaded from the configuration has its static initialiser invoked, which in turn in the application code calls org.apache.log4j.PropertyConfigurator.configure(java.util.Properties). This results in all log appenders being removed, therefore geronimo.log gets closed. The EJB's static initialisation added its own appender / log file, e.g. myApp.log. At this point it appears we are not logging to geronimo.log. Thread [main] (Suspended (breakpoint at line 171 in org.apache.log4j.FileAppender)) org.apache.log4j.RollingFileAppender(org.apache.log4j.FileAppender).closeFile() line: 171 org.apache.log4j.RollingFileAppender(org.apache.log4j.FileAppender).reset() line: 302 org.apache.log4j.RollingFileAppender(org.apache.log4j.WriterAppender).close() line: 195 org.apache.log4j.helpers.AppenderAttachableImpl.removeAllAppenders() line: 132 org.apache.log4j.spi.RootCategory(org.apache.log4j.Category).removeAllAppenders() line: 879 org.apache.log4j.PropertyConfigurator.parseCategory(java.util.Properties, org.apache.log4j.Logger, java.lang.String, java.lang.String, java.lang.String) line: 594 org.apache.log4j.PropertyConfigurator.configureRootCategory(java.util.Properties, org.apache.log4j.spi.LoggerRepository) line: 500 org.apache.log4j.PropertyConfigurator.doConfigure(java.util.Properties, org.apache.log4j.spi.LoggerRepository) line: 406 org.apache.log4j.PropertyConfigurator.configure(java.util.Properties) line: 340 com.blah.server.ejb.ServerConfigPvtBean.() line: not available java.io.ObjectStreamClass.hasStaticInitializer(java.lang.Class) line: not available [native method] java.io.ObjectStreamClass.computeDefaultSUID(java.lang.Class) line: 1557 java.io.ObjectStreamClass.access$100(java.lang.Class) line: 47 java.io.ObjectStreamClass$1.run() line: 173 java.security.AccessController.doPrivileged(java.security.PrivilegedAction) line: not available [native method] java.io.ObjectStreamClass.getSerialVersionUID() line: 170 java.io.ObjectStreamClass.initNonProxy(java.io.ObjectStreamClass, java.lang.Class, java.lang.ClassNotFoundException, java.io.ObjectStreamClass) line: 459 org.apache.geronimo.kernel.ObjectInputStreamExt(java.io.ObjectInputStream).readObject() line: 324 org.apache.geronimo.gbean.GBeanData.readExternal(java.io.ObjectInput) line: 169 org.apache.geronimo.kernel.config.Configuration.loadGBeans(byte[], java.lang.ClassLoader) line: 388 org.apache.geronimo.kernel.config.Configuration.(...) line: 208 sun.reflect.NativeConstructorAccessorImpl.newInstance0(java.lang.reflect.Constructor, java.lang.Object[]) line: not available [native method] sun.reflect.NativeConstructorAccessorImpl.newInstance(java.lang.Object[]) line: 39 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.lang.Object[]) line: 27 java.lang.reflect.Constructor.newInstance(java.lang.Object[]) line: 274 org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance() line: 806 org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart() line: 331 org.apache.geronimo.gbean.runtime.GBeanInstanceState.start() line: 111 org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive() line: 133 org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive() line: 494 org.apache.geronimo.kernel.Kernel.startRecursiveGBean(javax.management.ObjectName) line: 339 org.apache.geronimo.system.main.Daemon.main(java.lang.String[]) line: 185 4) The Timer started by the Log4jService earlier, is executed and reconfigures log4j, causing all appenders to be removed, therefore myApp.log is closed. Then geronimo.log will be reopened. If log4j.appender.FILE.append=false was specified in server-log4j.properties, then any existing data in geronimo.log is erased. Thread [Thread-1] (Suspended (breakpoint at line 171 in org.apache.log4j.FileAppender)) org.apache.log4j.RollingFileAppender(org.apache.log4j.FileAppender).closeFile() line: 171
Re: Logging problems
On Nov 10, 2004, at 10:34 AM, Bruce Snyder wrote:
Any reason why the Log4J configs are using a properties file rather
than XML?
We do use the ${property} replacement stuff in properties version, so
the log file location is relative to geronimo home, but if the xml
version supports that we could also be used. The code that loads the
configuration file supports both log4j xml and properties configs.
If you can get it to work with the xml version, feel free to convert
the files over (don't forget about the openejb ones).
-dain
--
Dain Sundstrom
Chief Architect
Gluecode Software
310.536.8355, ext. 26
Re: [BULK] Re: Logging problems
On Nov 10, 2004, at 3:49 AM, David Farb wrote: Geir Magnusson Jr wrote: What are the repercussions for existing users? Speaking as one (1) existing user, it means I have to rip out things that were working (log4j.xml, system-plan.xml, and daily logs) and figure out how to get back to the state I was in before with the new code. About one day or so of work that I would rather not have to do right now. Relax, it took me 5 minutes to convert over geronimo and openejb. Just remove the appenders from the plans and the root level attribute from the Log4j gbean configuration. Your exiting log4j.xml will continue to work as it did before. This change simply reenforces that the log4j.xml (or properties) file is in charge. -dain
Re: Logging problems
On Nov 10, 2004, at 9:13 AM, Geir Magnusson Jr wrote: What are the repercussions for existing users? In the system plan you remove any references to appenders. In the Log4jSerivce gbean you remove the root level attribute. That't it. -dain
Re: Logging problems
Dain Sundstrom wrote:
On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote:
Log4j GBeans
Our current log4j gbeans attempt to control the creation of log
objects, priories... basically the log4j configuration. The problem I
have found is any application can come along and "reset" the current
log4j configuration and reinitialize the system. I do not believe
there is any way to prevent this. It is on of those problems that
everyone had control which in effect gives no one control.
I propose that we drop all of our gbeans that try to control Log4j and
instead go to a single gbean that exposes the operations of
LogManager, and a log4j.xml file (as a big string). The big string
would be a persisted to somewhere like var/log4.xml.
I just committed this. We now have var/log/*-log4j.properties to
control the server, client and deployer logs. I'd appreciate any feed
back quickly, as we are going to (try to) cut M3 tomorrow afternoon.
Any reason why the Log4J configs are using a properties file rather than
XML?
Bruce
--
perl -e 'print
unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E
The Castor Project
http://www.castor.org/
Apache Geronimo
http://geronimo.apache.org/
[BULK] Re: Logging problems
Geir Magnusson Jr wrote: >What are the repercussions for existing users? Speaking as one (1) existing user, it means I have to rip out things that were working (log4j.xml, system-plan.xml, and daily logs) and figure out how to get back to the state I was in before with the new code. About one day or so of work that I would rather not have to do right now.
Re: Logging problems
On Nov 10, 2004, at 12:29 AM, Dain Sundstrom wrote: On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote: Log4j GBeans Our current log4j gbeans attempt to control the creation of log objects, priories... basically the log4j configuration. The problem I have found is any application can come along and "reset" the current log4j configuration and reinitialize the system. I do not believe there is any way to prevent this. It is on of those problems that everyone had control which in effect gives no one control. I propose that we drop all of our gbeans that try to control Log4j and instead go to a single gbean that exposes the operations of LogManager, and a log4j.xml file (as a big string). The big string would be a persisted to somewhere like var/log4.xml. I just committed this. We now have var/log/*-log4j.properties to control the server, client and deployer logs. I'd appreciate any feed back quickly, as we are going to (try to) cut M3 tomorrow afternoon. What are the repercussions for existing users? -dain -- Geir Magnusson Jr +1-203-665-6437 [EMAIL PROTECTED]
Re: Logging problems
On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote: Log4j GBeans Our current log4j gbeans attempt to control the creation of log objects, priories... basically the log4j configuration. The problem I have found is any application can come along and "reset" the current log4j configuration and reinitialize the system. I do not believe there is any way to prevent this. It is on of those problems that everyone had control which in effect gives no one control. I propose that we drop all of our gbeans that try to control Log4j and instead go to a single gbean that exposes the operations of LogManager, and a log4j.xml file (as a big string). The big string would be a persisted to somewhere like var/log4.xml. I just committed this. We now have var/log/*-log4j.properties to control the server, client and deployer logs. I'd appreciate any feed back quickly, as we are going to (try to) cut M3 tomorrow afternoon. -dain
[BULK] Re: Logging problems
Jeremy Boynes wrote: > We would need to provide a solution though for things that aren't > GBeans. Perhaps a way that a GBean could create a "child" logger of the > one it had that it could inject into other things and recursively down? One of the benefits of the current scheme is that each class, whether it is a GBean or not, can have its logging level controlled individually. If all classes used in a GBean are controlled by the same logger, what happens to instances of classes shared by several GBeans? E.g. How do you control logging of o.a.g.security.ContextManager (assuming it had a log and you wanted to control it)? If the GBean controls logging, and only diagnostics from some non-GBean instance is wanted, is the only choice to get diagnostics from everything that GBean uses? For example, how would the logging in o.a.g.network.protocol.SocketProtocol be done? This class creats a new, controllable, log for each instance. And it is NOT a GBean.
Re: Logging problems
Dain Sundstrom wrote:
As of an IoCish solution If we changed our components to declare a
dependency on a Log, the kernel can initialize a log and inject it into
the component. For example, instead of a component using this code to
get a log:
public class MyService {
private static final Log log = LogFactory.getLog(MyService.class);
public MyService() {
log.info("Blah");
}
}
You do this:
public class MyService {
private final Log log;
public MyService(Log log) {
this.log = log;
log.info("Blah");
}
}
The key here is code is not directly accessing a LogFactory. This
allows us to provide a log implementation that connects to any log
framework. It also allows the container add additional information to
the log events under the covers of the interface, such as the object
name of the component.
This seems really cool for GBeans. I have a vague concern the name in
the log file would be long (especially for 77 objects) making it hard to
read in vi but on the other hand it would be good to be able to
differentiate between different GBeans.
We would need to provide a solution though for things that aren't
GBeans. Perhaps a way that a GBean could create a "child" logger of the
one it had that it could inject into other things and recursively down?
--
Jeremy
Re: Logging problems
On Nov 8, 2004, at 10:49 PM, Bruce Snyder wrote:
Dain Sundstrom wrote:
I've thought about this, but it would mean that our code is locked to
a single log solution. This means that is someone wanted to swipe
our transaction manager they would have to use log4j (for example).
If we instead follow the example of mx4j and use a single simple log
interface anyone would be able to adapt it to their logging system.
Build only what we need now, don't get hung up on all the possible
what-if scenarios. Unless the what-if scenario is a driving factor. I
haven't seen or been part of any discussions where architecture was
driven by 'someone [who] wanted to swipe our tx mgr'. (Yes, I'm being
a smart ass ;-))
I have been part of several discussions, where someone mentioned they
wanted to use just one part of our server. Each time questions like
what do you use for logging, lifecycle and such come up. Anyway, I
don't think there is any reason to use one log interface over another,
especially when you consider how easy it is to write an adapter.
Please use only Log4J for all Geronimo logging.
:) I wasn't going to go there. There are many people that think we
should use java.util.logging. I personally think we should shoot for
an IOC solution where the integrator of the components (the Kernel in
our case) gets to choose the logging system.
Tell me more about the IoC solution. I like the sound of it. But I
definitely do *not* like the java.util.logging remark.
BTW, people do like it. I have been asked on more then one occasion
why we don't just use util.logging directly instead of commons-logging,
and I always respond with a comment about the guy on the other side
arguing that we go to log4j directly.
As of an IoCish solution If we changed our components to declare a
dependency on a Log, the kernel can initialize a log and inject it into
the component. For example, instead of a component using this code to
get a log:
public class MyService {
private static final Log log = LogFactory.getLog(MyService.class);
public MyService() {
log.info("Blah");
}
}
You do this:
public class MyService {
private final Log log;
public MyService(Log log) {
this.log = log;
log.info("Blah");
}
}
The key here is code is not directly accessing a LogFactory. This
allows us to provide a log implementation that connects to any log
framework. It also allows the container add additional information to
the log events under the covers of the interface, such as the object
name of the component.
-dain
Re: Logging problems
Dain Sundstrom wrote:
Thanks for the response. My comments are inline...
On Nov 8, 2004, at 4:56 PM, Bruce Snyder wrote:
Dain Sundstrom wrote:
Either my email got lost in the flood or people are not too
opinionated on logging. Anyway, does anyone have an opinion on point
2 "Commons Log"?
I typed up quite a repsonse to your original message because I'm
pretty opinionated about Commons Logging. My guess is that my response
didn't make it to the list due to the outstanding network management
(couresty of IBM GS) at my client. I'll try to make this brief.
On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote:
After working with geronimo for a while, I am convinced our current
logging solution was a bad idea (on my part :). There are several
problems, so I'll try to categorize them.
Log4j GBeans
Our current log4j gbeans attempt to control the creation of log
objects, priories... basically the log4j configuration. The problem
I have found is any application can come along and "reset" the
current log4j configuration and reinitialize the system. I do not
believe there is any way to prevent this. It is on of those
problems that everyone had control which in effect gives no one
control.
I propose that we drop all of our gbeans that try to control Log4j
and instead go to a single gbean that exposes the operations of
LogManager, and a log4j.xml file (as a big string). The big string
would be a persisted to somewhere like var/log4.xml.
I like the idea of a LogManager far better. It seems like this would
protect the configuration better so that the rug won't be yanked out
from under the logging framework.
I'm not sure what you mean. Are you saying you like the idea of
exposing LogManager as I proposed, or would you prefer something else?
+1 for the LogManager class.
Commons Log
If we make the above changes, we will only be using the
org.apache.commons.logging.Log class from commons logging. The
problem is to get this class we include a commons-logging jar into
geronimo and this jar will carry a specific version number. This
means that all applications are restricted to use the version of
commons logging that we ship.
I can think of two solutions this problem: ship only the
org.apache.commons.logging.Log class with geronimo or repackage Log
into a geronimo package (say org.apache.geronimo.logging.Log or
org.apache.geronimo.logging.GLog). I don't have much of a
preference for either of these solutions, but I feel we must address
this problem.
I'm not a big fan of Commons Logging. I'm not going into the diatribe
I did in my lost message, but suffice it to say that it's one more
layer I don't feel we need and I'd rather see it go away. Pick a
single logging framework and use it. I vote against the use of Commons
Logging.
I've thought about this, but it would mean that our code is locked to a
single log solution. This means that is someone wanted to swipe our
transaction manager they would have to use log4j (for example). If we
instead follow the example of mx4j and use a single simple log interface
anyone would be able to adapt it to their logging system.
Build only what we need now, don't get hung up on all the possible
what-if scenarios. Unless the what-if scenario is a driving factor. I
haven't seen or been part of any discussions where architecture was
driven by 'someone [who] wanted to swipe our tx mgr'. (Yes, I'm being a
smart ass ;-))
I'm going to start working on the first proposal above, Log4j, as I
think it is the least controversial. If you have any concerns about
that one, please respond sooner rather then later.
Please use only Log4J for all Geronimo logging.
:) I wasn't going to go there. There are many people that think we
should use java.util.logging. I personally think we should shoot for an
IOC solution where the integrator of the components (the Kernel in our
case) gets to choose the logging system.
Tell me more about the IoC solution. I like the sound of it. But I
definitely do *not* like the java.util.logging remark.
Bruce
--
perl -e 'print
unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E
The Castor Project
http://www.castor.org/
Apache Geronimo
http://geronimo.apache.org/
Re: Logging problems
Thanks for the response. My comments are inline... On Nov 8, 2004, at 4:56 PM, Bruce Snyder wrote: Dain Sundstrom wrote: Either my email got lost in the flood or people are not too opinionated on logging. Anyway, does anyone have an opinion on point 2 "Commons Log"? I typed up quite a repsonse to your original message because I'm pretty opinionated about Commons Logging. My guess is that my response didn't make it to the list due to the outstanding network management (couresty of IBM GS) at my client. I'll try to make this brief. On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote: After working with geronimo for a while, I am convinced our current logging solution was a bad idea (on my part :). There are several problems, so I'll try to categorize them. Log4j GBeans Our current log4j gbeans attempt to control the creation of log objects, priories... basically the log4j configuration. The problem I have found is any application can come along and "reset" the current log4j configuration and reinitialize the system. I do not believe there is any way to prevent this. It is on of those problems that everyone had control which in effect gives no one control. I propose that we drop all of our gbeans that try to control Log4j and instead go to a single gbean that exposes the operations of LogManager, and a log4j.xml file (as a big string). The big string would be a persisted to somewhere like var/log4.xml. I like the idea of a LogManager far better. It seems like this would protect the configuration better so that the rug won't be yanked out from under the logging framework. I'm not sure what you mean. Are you saying you like the idea of exposing LogManager as I proposed, or would you prefer something else? Commons Log If we make the above changes, we will only be using the org.apache.commons.logging.Log class from commons logging. The problem is to get this class we include a commons-logging jar into geronimo and this jar will carry a specific version number. This means that all applications are restricted to use the version of commons logging that we ship. I can think of two solutions this problem: ship only the org.apache.commons.logging.Log class with geronimo or repackage Log into a geronimo package (say org.apache.geronimo.logging.Log or org.apache.geronimo.logging.GLog). I don't have much of a preference for either of these solutions, but I feel we must address this problem. I'm not a big fan of Commons Logging. I'm not going into the diatribe I did in my lost message, but suffice it to say that it's one more layer I don't feel we need and I'd rather see it go away. Pick a single logging framework and use it. I vote against the use of Commons Logging. I've thought about this, but it would mean that our code is locked to a single log solution. This means that is someone wanted to swipe our transaction manager they would have to use log4j (for example). If we instead follow the example of mx4j and use a single simple log interface anyone would be able to adapt it to their logging system. I'm going to start working on the first proposal above, Log4j, as I think it is the least controversial. If you have any concerns about that one, please respond sooner rather then later. Please use only Log4J for all Geronimo logging. :) I wasn't going to go there. There are many people that think we should use java.util.logging. I personally think we should shoot for an IOC solution where the integrator of the components (the Kernel in our case) gets to choose the logging system. -dain
Re: Logging problems
Dain Sundstrom wrote:
Either my email got lost in the flood or people are not too opinionated
on logging. Anyway, does anyone have an opinion on point 2 "Commons Log"?
I typed up quite a repsonse to your original message because I'm pretty
opinionated about Commons Logging. My guess is that my response didn't
make it to the list due to the outstanding network management (couresty
of IBM GS) at my client. I'll try to make this brief.
On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote:
After working with geronimo for a while, I am convinced our current
logging solution was a bad idea (on my part :). There are several
problems, so I'll try to categorize them.
Log4j GBeans
Our current log4j gbeans attempt to control the creation of log
objects, priories... basically the log4j configuration. The problem I
have found is any application can come along and "reset" the current
log4j configuration and reinitialize the system. I do not believe
there is any way to prevent this. It is on of those problems that
everyone had control which in effect gives no one control.
I propose that we drop all of our gbeans that try to control Log4j and
instead go to a single gbean that exposes the operations of
LogManager, and a log4j.xml file (as a big string). The big string
would be a persisted to somewhere like var/log4.xml.
I like the idea of a LogManager far better. It seems like this would
protect the configuration better so that the rug won't be yanked out
from under the logging framework.
Commons LogFactory
Currently all of our code uses commons logging. The problem is how we
obtain org.apache.commons.logging.Log implementation. This is most
common code in to obtain a Log:
private static Log log = LogFactory.getLog(MyGBean.class);
The problem is the static LogFactory. As with log4j above anyone can
come along an kick out our log factory. Also, the code we use to
setup the LogFactory on geronimo boot is very very ugly and error prone.
I propose we make "Log log" a GBean magic attributes, which means that
is automatically available to all gbeans (just like class loader and
kernel). If a gbean declares that it wants a log we will create and
initialize a log. This will also let the kernel add additional
information to log events such as gbean object name.
Commons Log
If we make the above changes, we will only be using the
org.apache.commons.logging.Log class from commons logging. The
problem is to get this class we include a commons-logging jar into
geronimo and this jar will carry a specific version number. This
means that all applications are restricted to use the version of
commons logging that we ship.
I can think of two solutions this problem: ship only the
org.apache.commons.logging.Log class with geronimo or repackage Log
into a geronimo package (say org.apache.geronimo.logging.Log or
org.apache.geronimo.logging.GLog). I don't have much of a preference
for either of these solutions, but I feel we must address this problem.
I'm not a big fan of Commons Logging. I'm not going into the diatribe I
did in my lost message, but suffice it to say that it's one more layer I
don't feel we need and I'd rather see it go away. Pick a single logging
framework and use it. I vote against the use of Commons Logging.
I'm going to start working on the first proposal above, Log4j, as I
think it is the least controversial. If you have any concerns about
that one, please respond sooner rather then later.
Please use only Log4J for all Geronimo logging.
Bruce
--
perl -e 'print
unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E
The Castor Project
http://www.castor.org/
Apache Geronimo
http://geronimo.apache.org/
Re: Logging problems
Yes that is the one. -dain On Nov 8, 2004, at 4:03 PM, Aaron Mulder wrote: If you mean the bit about distribute 1 class or repackage, I vote repackage. Aaron On Mon, 8 Nov 2004, Dain Sundstrom wrote: Either my email got lost in the flood or people are not too opinionated on logging. Anyway, does anyone have an opinion on point 2 "Commons Log"? -dain On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote: After working with geronimo for a while, I am convinced our current logging solution was a bad idea (on my part :). There are several problems, so I'll try to categorize them. Log4j GBeans Our current log4j gbeans attempt to control the creation of log objects, priories... basically the log4j configuration. The problem I have found is any application can come along and "reset" the current log4j configuration and reinitialize the system. I do not believe there is any way to prevent this. It is on of those problems that everyone had control which in effect gives no one control. I propose that we drop all of our gbeans that try to control Log4j and instead go to a single gbean that exposes the operations of LogManager, and a log4j.xml file (as a big string). The big string would be a persisted to somewhere like var/log4.xml. Commons LogFactory Currently all of our code uses commons logging. The problem is how we obtain org.apache.commons.logging.Log implementation. This is most common code in to obtain a Log: private static Log log = LogFactory.getLog(MyGBean.class); The problem is the static LogFactory. As with log4j above anyone can come along an kick out our log factory. Also, the code we use to setup the LogFactory on geronimo boot is very very ugly and error prone. I propose we make "Log log" a GBean magic attributes, which means that is automatically available to all gbeans (just like class loader and kernel). If a gbean declares that it wants a log we will create and initialize a log. This will also let the kernel add additional information to log events such as gbean object name. Commons Log If we make the above changes, we will only be using the org.apache.commons.logging.Log class from commons logging. The problem is to get this class we include a commons-logging jar into geronimo and this jar will carry a specific version number. This means that all applications are restricted to use the version of commons logging that we ship. I can think of two solutions this problem: ship only the org.apache.commons.logging.Log class with geronimo or repackage Log into a geronimo package (say org.apache.geronimo.logging.Log or org.apache.geronimo.logging.GLog). I don't have much of a preference for either of these solutions, but I feel we must address this problem. I'm going to start working on the first proposal above, Log4j, as I think it is the least controversial. If you have any concerns about that one, please respond sooner rather then later. Thanks, -dain -- Dain Sundstrom Chief Architect Gluecode Software 310.536.8355, ext. 26
Re: Logging problems
If you mean the bit about distribute 1 class or repackage, I vote repackage. Aaron On Mon, 8 Nov 2004, Dain Sundstrom wrote: > Either my email got lost in the flood or people are not too opinionated > on logging. Anyway, does anyone have an opinion on point 2 "Commons > Log"? > > -dain > > On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote: > > > After working with geronimo for a while, I am convinced our current > > logging solution was a bad idea (on my part :). There are several > > problems, so I'll try to categorize them. > > > > Log4j GBeans > > > > Our current log4j gbeans attempt to control the creation of log > > objects, priories... basically the log4j configuration. The problem I > > have found is any application can come along and "reset" the current > > log4j configuration and reinitialize the system. I do not believe > > there is any way to prevent this. It is on of those problems that > > everyone had control which in effect gives no one control. > > > > I propose that we drop all of our gbeans that try to control Log4j and > > instead go to a single gbean that exposes the operations of > > LogManager, and a log4j.xml file (as a big string). The big string > > would be a persisted to somewhere like var/log4.xml. > > > > Commons LogFactory > > > > Currently all of our code uses commons logging. The problem is how we > > obtain org.apache.commons.logging.Log implementation. This is most > > common code in to obtain a Log: > > > > private static Log log = LogFactory.getLog(MyGBean.class); > > > > The problem is the static LogFactory. As with log4j above anyone can > > come along an kick out our log factory. Also, the code we use to > > setup the LogFactory on geronimo boot is very very ugly and error > > prone. > > > > I propose we make "Log log" a GBean magic attributes, which means that > > is automatically available to all gbeans (just like class loader and > > kernel). If a gbean declares that it wants a log we will create and > > initialize a log. This will also let the kernel add additional > > information to log events such as gbean object name. > > > > Commons Log > > > > If we make the above changes, we will only be using the > > org.apache.commons.logging.Log class from commons logging. The > > problem is to get this class we include a commons-logging jar into > > geronimo and this jar will carry a specific version number. This > > means that all applications are restricted to use the version of > > commons logging that we ship. > > > > I can think of two solutions this problem: ship only the > > org.apache.commons.logging.Log class with geronimo or repackage Log > > into a geronimo package (say org.apache.geronimo.logging.Log or > > org.apache.geronimo.logging.GLog). I don't have much of a preference > > for either of these solutions, but I feel we must address this > > problem. > > > > > > I'm going to start working on the first proposal above, Log4j, as I > > think it is the least controversial. If you have any concerns about > > that one, please respond sooner rather then later. > > > > Thanks, > > > > -dain > > > > -- > > Dain Sundstrom > > Chief Architect > > Gluecode Software > > 310.536.8355, ext. 26 > >
Re: Logging problems
Either my email got lost in the flood or people are not too opinionated on logging. Anyway, does anyone have an opinion on point 2 "Commons Log"? -dain On Nov 5, 2004, at 1:29 PM, Dain Sundstrom wrote: After working with geronimo for a while, I am convinced our current logging solution was a bad idea (on my part :). There are several problems, so I'll try to categorize them. Log4j GBeans Our current log4j gbeans attempt to control the creation of log objects, priories... basically the log4j configuration. The problem I have found is any application can come along and "reset" the current log4j configuration and reinitialize the system. I do not believe there is any way to prevent this. It is on of those problems that everyone had control which in effect gives no one control. I propose that we drop all of our gbeans that try to control Log4j and instead go to a single gbean that exposes the operations of LogManager, and a log4j.xml file (as a big string). The big string would be a persisted to somewhere like var/log4.xml. Commons LogFactory Currently all of our code uses commons logging. The problem is how we obtain org.apache.commons.logging.Log implementation. This is most common code in to obtain a Log: private static Log log = LogFactory.getLog(MyGBean.class); The problem is the static LogFactory. As with log4j above anyone can come along an kick out our log factory. Also, the code we use to setup the LogFactory on geronimo boot is very very ugly and error prone. I propose we make "Log log" a GBean magic attributes, which means that is automatically available to all gbeans (just like class loader and kernel). If a gbean declares that it wants a log we will create and initialize a log. This will also let the kernel add additional information to log events such as gbean object name. Commons Log If we make the above changes, we will only be using the org.apache.commons.logging.Log class from commons logging. The problem is to get this class we include a commons-logging jar into geronimo and this jar will carry a specific version number. This means that all applications are restricted to use the version of commons logging that we ship. I can think of two solutions this problem: ship only the org.apache.commons.logging.Log class with geronimo or repackage Log into a geronimo package (say org.apache.geronimo.logging.Log or org.apache.geronimo.logging.GLog). I don't have much of a preference for either of these solutions, but I feel we must address this problem. I'm going to start working on the first proposal above, Log4j, as I think it is the least controversial. If you have any concerns about that one, please respond sooner rather then later. Thanks, -dain -- Dain Sundstrom Chief Architect Gluecode Software 310.536.8355, ext. 26
Re: Logging problems
Dain Sundstrom wrote: >--- >I propose we make "Log log" a GBean magic attributes, > which means that is automatically available to all > gbeans (just like class loader and kernel). If a > gbean declares that it wants a log we will create and > initialize a log. This will also let the kernel add > additional information to log events such as gbean > object name. What happens to classes that use logging that are NOT GBeans? They currently use the factory pattern.
Re: Logging problems
Exactly, we are bound to either break the axis one, or have axis break ours. I think the best solution is to simply avoid the static factory pattern all together. -dain On Nov 5, 2004, at 12:00 PM, Davanum Srinivas wrote: FYI, In Axis we have our own LogFactory (http://cvs.apache.org/viewcvs.cgi/ws-axis/java/src/org/apache/axis/ components/logger/LogFactory.java). -- dims On Fri, 5 Nov 2004 11:29:07 -0800, Dain Sundstrom <[EMAIL PROTECTED]> wrote: After working with geronimo for a while, I am convinced our current logging solution was a bad idea (on my part :). There are several problems, so I'll try to categorize them. Log4j GBeans Our current log4j gbeans attempt to control the creation of log objects, priories... basically the log4j configuration. The problem I have found is any application can come along and "reset" the current log4j configuration and reinitialize the system. I do not believe there is any way to prevent this. It is on of those problems that everyone had control which in effect gives no one control. I propose that we drop all of our gbeans that try to control Log4j and instead go to a single gbean that exposes the operations of LogManager, and a log4j.xml file (as a big string). The big string would be a persisted to somewhere like var/log4.xml. Commons LogFactory Currently all of our code uses commons logging. The problem is how we obtain org.apache.commons.logging.Log implementation. This is most common code in to obtain a Log: private static Log log = LogFactory.getLog(MyGBean.class); The problem is the static LogFactory. As with log4j above anyone can come along an kick out our log factory. Also, the code we use to setup the LogFactory on geronimo boot is very very ugly and error prone. I propose we make "Log log" a GBean magic attributes, which means that is automatically available to all gbeans (just like class loader and kernel). If a gbean declares that it wants a log we will create and initialize a log. This will also let the kernel add additional information to log events such as gbean object name. Commons Log If we make the above changes, we will only be using the org.apache.commons.logging.Log class from commons logging. The problem is to get this class we include a commons-logging jar into geronimo and this jar will carry a specific version number. This means that all applications are restricted to use the version of commons logging that we ship. I can think of two solutions this problem: ship only the org.apache.commons.logging.Log class with geronimo or repackage Log into a geronimo package (say org.apache.geronimo.logging.Log or org.apache.geronimo.logging.GLog). I don't have much of a preference for either of these solutions, but I feel we must address this problem. I'm going to start working on the first proposal above, Log4j, as I think it is the least controversial. If you have any concerns about that one, please respond sooner rather then later. Thanks, -dain -- Dain Sundstrom Chief Architect Gluecode Software 310.536.8355, ext. 26 -- Davanum Srinivas - http://webservices.apache.org/~dims/
Re: Logging problems
Dain Sundstrom wrote: >--- >Log4j GBeans > Our current log4j gbeans attempt to control the > creation of log objects, priories... basically the > log4j configuration. The problem I have found is any > application can come along and "reset" the current > log4j configuration and reinitialize the system. > I do not believe there is any way to prevent this. This would probably fix Jira Geronimo issue 287. It appears that log4j is re-initialized several times during Geronimo operations.
Re: Logging problems
FYI, In Axis we have our own LogFactory (http://cvs.apache.org/viewcvs.cgi/ws-axis/java/src/org/apache/axis/components/logger/LogFactory.java). -- dims On Fri, 5 Nov 2004 11:29:07 -0800, Dain Sundstrom <[EMAIL PROTECTED]> wrote: > After working with geronimo for a while, I am convinced our current > logging solution was a bad idea (on my part :). There are several > problems, so I'll try to categorize them. > > Log4j GBeans > > Our current log4j gbeans attempt to control the creation of log > objects, priories... basically the log4j configuration. The problem I > have found is any application can come along and "reset" the current > log4j configuration and reinitialize the system. I do not believe > there is any way to prevent this. It is on of those problems that > everyone had control which in effect gives no one control. > > I propose that we drop all of our gbeans that try to control Log4j and > instead go to a single gbean that exposes the operations of LogManager, > and a log4j.xml file (as a big string). The big string would be a > persisted to somewhere like var/log4.xml. > > Commons LogFactory > > Currently all of our code uses commons logging. The problem is how we > obtain org.apache.commons.logging.Log implementation. This is most > common code in to obtain a Log: > > private static Log log = LogFactory.getLog(MyGBean.class); > > The problem is the static LogFactory. As with log4j above anyone can > come along an kick out our log factory. Also, the code we use to setup > the LogFactory on geronimo boot is very very ugly and error prone. > > I propose we make "Log log" a GBean magic attributes, which means that > is automatically available to all gbeans (just like class loader and > kernel). If a gbean declares that it wants a log we will create and > initialize a log. This will also let the kernel add additional > information to log events such as gbean object name. > > Commons Log > > If we make the above changes, we will only be using the > org.apache.commons.logging.Log class from commons logging. The problem > is to get this class we include a commons-logging jar into geronimo and > this jar will carry a specific version number. This means that all > applications are restricted to use the version of commons logging that > we ship. > > I can think of two solutions this problem: ship only the > org.apache.commons.logging.Log class with geronimo or repackage Log > into a geronimo package (say org.apache.geronimo.logging.Log or > org.apache.geronimo.logging.GLog). I don't have much of a preference > for either of these solutions, but I feel we must address this problem. > > I'm going to start working on the first proposal above, Log4j, as I > think it is the least controversial. If you have any concerns about > that one, please respond sooner rather then later. > > Thanks, > > -dain > > -- > Dain Sundstrom > Chief Architect > Gluecode Software > 310.536.8355, ext. 26 > > -- Davanum Srinivas - http://webservices.apache.org/~dims/
Logging problems
After working with geronimo for a while, I am convinced our current logging solution was a bad idea (on my part :). There are several problems, so I'll try to categorize them. Log4j GBeans Our current log4j gbeans attempt to control the creation of log objects, priories... basically the log4j configuration. The problem I have found is any application can come along and "reset" the current log4j configuration and reinitialize the system. I do not believe there is any way to prevent this. It is on of those problems that everyone had control which in effect gives no one control. I propose that we drop all of our gbeans that try to control Log4j and instead go to a single gbean that exposes the operations of LogManager, and a log4j.xml file (as a big string). The big string would be a persisted to somewhere like var/log4.xml. Commons LogFactory Currently all of our code uses commons logging. The problem is how we obtain org.apache.commons.logging.Log implementation. This is most common code in to obtain a Log: private static Log log = LogFactory.getLog(MyGBean.class); The problem is the static LogFactory. As with log4j above anyone can come along an kick out our log factory. Also, the code we use to setup the LogFactory on geronimo boot is very very ugly and error prone. I propose we make "Log log" a GBean magic attributes, which means that is automatically available to all gbeans (just like class loader and kernel). If a gbean declares that it wants a log we will create and initialize a log. This will also let the kernel add additional information to log events such as gbean object name. Commons Log If we make the above changes, we will only be using the org.apache.commons.logging.Log class from commons logging. The problem is to get this class we include a commons-logging jar into geronimo and this jar will carry a specific version number. This means that all applications are restricted to use the version of commons logging that we ship. I can think of two solutions this problem: ship only the org.apache.commons.logging.Log class with geronimo or repackage Log into a geronimo package (say org.apache.geronimo.logging.Log or org.apache.geronimo.logging.GLog). I don't have much of a preference for either of these solutions, but I feel we must address this problem. I'm going to start working on the first proposal above, Log4j, as I think it is the least controversial. If you have any concerns about that one, please respond sooner rather then later. Thanks, -dain -- Dain Sundstrom Chief Architect Gluecode Software 310.536.8355, ext. 26
