Hi folks,
I submitted a patch for GEOS-2284. What this patch does preserver any non file and non console appenders when configuring or reconfiguring GeoServer logging. The rationale being to allow other appenders to remain in tact.
My specific use case here is for the mac installer. Since on mac os starting GeoServer or an application won't fire up a console to capture the logs I needed another way to capture them. However as soon as logging in gs gets configured my appender is wiped out.
So, so if someone could review the patch for me that would be great. Thanks.
-Justin
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
Justin Deoliveira ha scritto:
Hi folks,
I submitted a patch for GEOS-2284. What this patch does preserver any non file and non console appenders when configuring or reconfiguring GeoServer logging. The rationale being to allow other appenders to remain in tact.
My specific use case here is for the mac installer. Since on mac os starting GeoServer or an application won't fire up a console to capture the logs I needed another way to capture them. However as soon as logging in gs gets configured my appender is wiped out.
So, so if someone could review the patch for me that would be great. Thanks.
Here we go. Hum, logging should not be configured with
GeoServer.configureGeoServerLogging, after the changes for
http://jira.codehaus.org/browse/GEOS-1671 nothing is using that method anymore (at least on my checkout), and afaik it wasn't used by startup
code even before that change (only test setup used it).
The code that actually does something is in LoggingInitializer, the
method is basically the same.
Besides this the patch looks good to me.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
Andrea Aime ha scritto:
Justin Deoliveira ha scritto:
Hi folks,
I submitted a patch for GEOS-2284. What this patch does preserver any non file and non console appenders when configuring or reconfiguring GeoServer logging. The rationale being to allow other appenders to remain in tact.
My specific use case here is for the mac installer. Since on mac os starting GeoServer or an application won't fire up a console to capture the logs I needed another way to capture them. However as soon as logging in gs gets configured my appender is wiped out.
So, so if someone could review the patch for me that would be great. Thanks.
Here we go. Hum, logging should not be configured with
GeoServer.configureGeoServerLogging, after the changes for
http://jira.codehaus.org/browse/GEOS-1671 nothing is using that method anymore (at least on my checkout), and afaik it wasn't used by startup
code even before that change (only test setup used it).
The code that actually does something is in LoggingInitializer, the
method is basically the same.
Besides this the patch looks good to me.
Ah, one more thing. The forward port on trunk requires patching a different class, as on trunk the logging is configured in a utility
class, LoggingUtils, so that the code can be shared between the
LoggingStartupContextListener (that configures logging before anything
else has a chance to use it) and the LoggingInitializer (that adds
a listener reconfiguring loggin when the user changes the config in
the UI). (trunk is doing "the right thing" but you asked me not
to backport the fuller solution to avoid harming stability, so we
have different code on 1.7.x and trunk).
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
Here we go. Hum, logging should not be configured with
GeoServer.configureGeoServerLogging, after the changes for
http://jira.codehaus.org/browse/GEOS-1671 nothing is using that method anymore (at least on my checkout), and afaik it wasn't used by startup
code even before that change (only test setup used it).
Right, forgot about that. This patch is a couple of months old so it was done before that change. I will update it to reflect the new way of things. Also do need to keep the method on GEoServer around? Should we kill it. Maybe just mark it with a big nasty comment for now.
The code that actually does something is in LoggingInitializer, the
method is basically the same.
Besides this the patch looks good to me.
Cheers
Andrea
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
Ah, one more thing. The forward port on trunk requires patching a different class, as on trunk the logging is configured in a utility
class, LoggingUtils, so that the code can be shared between the
LoggingStartupContextListener (that configures logging before anything
else has a chance to use it) and the LoggingInitializer (that adds
a listener reconfiguring loggin when the user changes the config in
the UI). (trunk is doing "the right thing" but you asked me not
to backport the fuller solution to avoid harming stability, so we
have different code on 1.7.x and trunk).
Cool, thanks for the heads up.
Cheers
Andrea
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
Justin Deoliveira ha scritto:
Here we go. Hum, logging should not be configured with
GeoServer.configureGeoServerLogging, after the changes for
http://jira.codehaus.org/browse/GEOS-1671 nothing is using that method anymore (at least on my checkout), and afaik it wasn't used by startup
code even before that change (only test setup used it).
Right, forgot about that. This patch is a couple of months old so it was done before that change. I will update it to reflect the new way of things. Also do need to keep the method on GEoServer around? Should we kill it. Maybe just mark it with a big nasty comment for now.
I actually would just kill it, it's not like GeoServer is exposing
an API that we need to keep stable from release to release.
Let's use this freedom while we can 
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.