[Geoserver-users] Logging

Hello,

I'm trying to configure Geoserver so that it will log its error to sentry (getsentry.com).
There is a raven-log4j which should do this for me.
The first step was creating a new log4j logging file.

So far I am following the following:
http://docs.geoserver.org/stable/en/user/advanced/logging.html

I deployed the latest stable geoserver (WAR) on ubuntu with tomcat 7.
I added a GEOTOOLS_DEVELOPER_LOGGING example configuration in the file
GEOTOOLS_TEST_LOGGING.properties.
I added the file in the following directory /var/lib/tomcat7/webapps/geoserver/data/logs.
Next up was a tomcat7 restart.
The file didn't show under Logging Profile on the global settings page.

What do I need to do differently to let the new logging file show up on the global settings page?

Thank you,

Roland

On 08/28/2013 05:49 PM, Roland van Laar wrote:

Hello,

I started to look at the code for GeoServer this morning.

I'm trying to configure Geoserver so that it will log its error to sentry (getsentry.com).
There is a raven-log4j which should do this for me.
The first step was creating a new log4j logging file.

So far I am following the following:
http://docs.geoserver.org/stable/en/user/advanced/logging.html

So far I've found the following:
- Configuration files should end in logging.properties, case insensitive.
- The configuration files are picked up when put in /var/log/tomcat7/

Probably the log files are loaded before setBaseDirectory in GeoServerResourceLoader is called.
I did set the datadir in web.xml to /var/lib/tomcat6/webapps/geoserver/data

Any ideas what to do next to import the log files from the data/logs dir?

I deployed the latest stable geoserver (WAR) on ubuntu with tomcat 7.
I added a GEOTOOLS_DEVELOPER_LOGGING example configuration in the file
GEOTOOLS_TEST_LOGGING.properties.
I added the file in the following directory /var/lib/tomcat7/webapps/geoserver/data/logs.
Next up was a tomcat7 restart.
The file didn't show under Logging Profile on the global settings page.

What do I need to do differently to let the new logging file show up on the global settings page?

Thnx,

Thank you,

Roland

On Thu, Aug 29, 2013 at 11:31 AM, Roland van Laar <roland@anonymised.com> wrote:

On 08/28/2013 05:49 PM, Roland van Laar wrote:
> Hello,
>
I started to look at the code for GeoServer this morning.
> I'm trying to configure Geoserver so that it will log its error to
> sentry (getsentry.com).
> There is a raven-log4j which should do this for me.
> The first step was creating a new log4j logging file.
>
> So far I am following the following:
> http://docs.geoserver.org/stable/en/user/advanced/logging.html

So far I've found the following:
- Configuration files should end in logging.properties, case insensitive.
- The configuration files are picked up when put in /var/log/tomcat7/

Probably the log files are loaded before setBaseDirectory in
GeoServerResourceLoader is called.
I did set the datadir in web.xml to /var/lib/tomcat6/webapps/geoserver/data

Yes, this issue has been reported in JIra too:
http://jira.codehaus.org/browse/GEOS-5989

Any ideas what to do next to import the log files from the data/logs dir?

Eh, someone has to take some time, look into the issue, and create a patch
to
solve it

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

Thanks

On 08/29/2013 12:25 PM, Andrea Aime wrote:

On Thu, Aug 29, 2013 at 11:31 AM, Roland van Laar <roland@anonymised.com <mailto:roland@anonymised.com>> wrote:

    On 08/28/2013 05:49 PM, Roland van Laar wrote:
    > Hello,
    >
    I started to look at the code for GeoServer this morning.
    > I'm trying to configure Geoserver so that it will log its error to
    > sentry (getsentry.com <http://getsentry.com>).
    > There is a raven-log4j which should do this for me.
    > The first step was creating a new log4j logging file.
    >
    > So far I am following the following:
    > http://docs.geoserver.org/stable/en/user/advanced/logging.html

    So far I've found the following:
    - Configuration files should end in logging.properties, case
    insensitive.
    - The configuration files are picked up when put in /var/log/tomcat7/

    Probably the log files are loaded before setBaseDirectory in
    GeoServerResourceLoader is called.
    I did set the datadir in web.xml to
    /var/lib/tomcat6/webapps/geoserver/data

Yes, this issue has been reported in JIra too:
http://jira.codehaus.org/browse/GEOS-5989

    Any ideas what to do next to import the log files from the
    data/logs dir?

Eh, someone has to take some time, look into the issue, and create a patch to
solve it

Cheers
Andrea
--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

For those wishing to use Sentry for logging, I got it working :-).
I'm using raven-java: https://github.com/kencochrane/raven-java

1) Copy the default logger 'PRODUCTION_LOGGING.properties' file to SENTRY_LOGGING.properties
2) Open the file in a text editor
3) Change the line that starts with log4j.rootLogger to:
log4j.rootLogger=WARN, geoserverlogfile, stdout, SentryAppender
4) Add the following to the file, change the sentry, key, host and ID :
log4j.appender.SentryAppender=net.kencochrane.raven.log4j.SentryAppender
log4j.appender.SentryAppender.dsn=http://SENTRY:KEY@anonymised.com/ID

5) Download necessary jars:
Read: https://github.com/kencochrane/raven-java/tree/master/raven-log4j#manual-dependency-management
And install them to geoserver/WEB-INF/lib
6) I needed to remove my old commons-codec and log4j jars.
7) Restart tomcat
8) Select the new SENTRY_LOGGING.properties in the Global Settings menu.
9) Voila

Roland

On 08/29/2013 11:31 AM, Roland van Laar wrote:

On 08/28/2013 05:49 PM, Roland van Laar wrote:

Hello,

I started to look at the code for GeoServer this morning.

I'm trying to configure Geoserver so that it will log its error to sentry (getsentry.com).
There is a raven-log4j which should do this for me.
The first step was creating a new log4j logging file.

So far I am following the following:
http://docs.geoserver.org/stable/en/user/advanced/logging.html

So far I've found the following:
- Configuration files should end in logging.properties, case insensitive.
- The configuration files are picked up when put in /var/log/tomcat7/

Probably the log files are loaded before setBaseDirectory in GeoServerResourceLoader is called.
I did set the datadir in web.xml to /var/lib/tomcat6/webapps/geoserver/data

Any ideas what to do next to import the log files from the data/logs dir?

I deployed the latest stable geoserver (WAR) on ubuntu with tomcat 7.
I added a GEOTOOLS_DEVELOPER_LOGGING example configuration in the file
GEOTOOLS_TEST_LOGGING.properties.
I added the file in the following directory /var/lib/tomcat7/webapps/geoserver/data/logs.
Next up was a tomcat7 restart.
The file didn't show under Logging Profile on the global settings page.

What do I need to do differently to let the new logging file show up on the global settings page?

Thnx,

Thank you,

Roland

On Thu, Aug 29, 2013 at 5:24 PM, Roland van Laar <roland@anonymised.com> wrote:

For those wishing to use Sentry for logging, I got it working :-).
I'm using raven-java: https://github.com/kencochrane/raven-java

1) Copy the default logger 'PRODUCTION_LOGGING.properties' file to
SENTRY_LOGGING.properties
2) Open the file in a text editor
3) Change the line that starts with log4j.rootLogger to:
log4j.rootLogger=WARN, geoserverlogfile, stdout, SentryAppender
4) Add the following to the file, change the sentry, key, host and ID :
log4j.appender.SentryAppender=net.kencochrane.raven.log4j.SentryAppender
log4j.appender.SentryAppender.dsn=http://SENTRY:KEY@anonymised.com/ID

5) Download necessary jars:
Read:

https://github.com/kencochrane/raven-java/tree/master/raven-log4j#manual-dependency-management
And install them to geoserver/WEB-INF/lib
6) I needed to remove my old commons-codec and log4j jars.
7) Restart tomcat
8) Select the new SENTRY_LOGGING.properties in the Global Settings menu.
9) Voila

Nice recipe, thanks for sharing :slight_smile:

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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