#1 2015-07-10 20:34:18

awilcox
Member
Registered: 2015-03-02

Log file format

Hi,

When I modify the log4j.appender.stdout.layout.ConversionPattern value in log4j.properties under ../WEB-INF/classes, not all the logs in the catalina.out file are written with the new format. Hibernate logs and logs from my groovy scripts (that I set up to use log4j) use the new format. Logs from datenwerke and org.eclipse.birt do not, even if I explicitly try and add entries in log4j.properties for them.

Here is a sample snippet (note the log from net.datenwerke is a different format):

16:23:59,278  WARN Loader:209 - HHH000444: Encountered request for locking however dialect reports that database prefers locking be done in a separate select (follow-on locking); results will be locked after initial query executes
16:24:00,004  INFO IndexingProgressMonitor:74 - HSEARCH000029: Indexing completed. Reindexed 65 entities. Unregistering MBean from server
Jul 10, 2015 4:24:00 PM net.datenwerke.rs.search.service.search.SearchServiceImpl rebuildIndex
INFO: Hibernate Search: (updating): [DashboardFolder] org.hibernate.search.jmx.IndexingProgressMonitor@2547494

16:24:00,276  WARN Loader:209 - HHH000444: Encountered request for locking however dialect reports that database prefers locking be done in a separate select (follow-on locking); results will be locked after initial query executes
16:24:00,280  INFO IndexingProgressMonitor:74 - HSEARCH000029: Indexing completed. Reindexed 1 entities. Unregistering MBean from server
16:24:01,532  INFO Startup:? - Starting script: cbnStartup.groovy

What do I need to do to change the format of logs from datenwerke and Birt?

Thanks,
Alana

Offline

#2 2015-07-13 15:48:09

Thorsten J. Krause
Guest

Re: Log file format

Hi Alana,

there was something really wrong with ReportServers internal usage of different logging frameworks and we ended up with different parts of the application using different logging facilities.

I think I was successful in getting this sorted out - If you like please update to the latest build (5705).

From this build on ReportServer exclusively uses logback (http://logback.qos.ch/) for logging and all third party library log outputs get intercepted and merged with the ReportServer log. To customize the logback configuration update the file logback-rs.xml in the WEB-INF/classes directory or create a file with the same name in the rs.configdir.

An alternative when using tomcat is to configure reportserver to use jdk14 logging, wich allows the integration with the tomcat logging facility. To enable this feature edit the logging.properties file in the tomcat/conf directory and define a new handler for reportserver. Make sure the first component of the handler name is "reportserver" so reportserver can configure itself to use this handler.

In details the necessary changes to tomcats logging.properties are:

# Add reportserver handler to general handler definition:
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, 5reportserver.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

# Configure the handler:
5reportserver.org.apache.juli.FileHandler.level = FINE
5reportserver.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
5reportserver.org.apache.juli.FileHandler.prefix = reportserver.

# Optionally change the handler message pattern:
java.util.logging.SimpleFormatter.format = [%1$tc] %4$s: %2$s - %5$s %6$s%n

#make handler receive rs-related tomcat messages:
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/reportserver].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/reportserver].handlers = 5reportserver.org.apache.juli.FileHandler

To change the loglevel edit the file logging-rs.properties in the WE-INF/classes folder or create a copy of this file in your rs.configdir.

Cheers,
Thorsten

#3 2015-07-14 15:45:06

awilcox
Member
Registered: 2015-03-02

Re: Log file format

Hi Thorsten,

Great! I used your first approach of logback-rs.xml under the rs.configdir with this release (5705) and it's working well. The logs are looking more consistent now.

Thanks very much,
Alana

Offline

#4 2015-07-24 19:08:13

awilcox
Member
Registered: 2015-03-02

Re: Log file format

Hi Thorsten,

Related to the logging, we have noticed that we always get the following error logs on restart. I believe this started around build #5700.

First one:

Jul 24, 2015 12:52:47 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
SEVERE: Unable to process Jar entry [javassist/util/proxy/SerializedProxy.class] from Jar [jar:file:/usr/share/tomcat/webapps/reportserver/WEB-INF/lib/javassist-3.19.0-GA.jar!/] for annotations
java.io.EOFException
        at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:340)
        at org.apache.tomcat.util.bcel.classfile.Utility.swallowMethodParameters(Utility.java:797)
        at org.apache.tomcat.util.bcel.classfile.Attribute.readAttribute(Attribute.java:171)
        at org.apache.tomcat.util.bcel.classfile.FieldOrMethod.<init>(FieldOrMethod.java:57)
        at org.apache.tomcat.util.bcel.classfile.Method.<init>(Method.java:71)
        at org.apache.tomcat.util.bcel.classfile.ClassParser.readMethods(ClassParser.java:267)
        at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:127)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2058)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1934)
        at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1900)
        at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1885)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1317)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1862)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

Second one (not really an ERROR log, it's part of the output of an INFO log, but has there been a schema change that we are missing?) :

### DB Config ###
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect (OK)
hibernate.driver_class: org.postgresql.Driver (OK)
hibernate.connection.url: jdbc:postgresql://127.0.0.1:5432/db (OK)
hibernate.connection.username: rptowner
hibernate.connection.password: ********
hibernate.default_schema: 

Connection Test: OK
Schema Version: Unknown (ERROR: relation "rs_schemainfo" does not exist
  Position: 15)

Thanks,
Alana

Offline

#5 2015-07-24 19:51:36

Thorsten J. Krause
Guest

Re: Log file format

Hi Alana,

the first one seems to be an tomcat issue:
https://github.com/jboss-javassist/javassist/issues/29
http://stackoverflow.com/questions/2527 … exceptions

The second one is a first sign of an upcoming improvement. Future versions will verify that the database version matches the application version. But for now it does nothing, so you can safely ignore the message.

Cheers,
Thorsten

Board footer

Powered by FluxBB