Logging oaicat

What happened before

So, I gave up installing tomcat on my laptop last week or so. Instead I use my ubuntu box at home now. That gave new headaches for a few evenings, but it was solvable and now it works reliably. At first I installed oaicat.war, then updated to 1.5.57 jar distribution and today, I was able to compile oaicat from source using netbeans. I guess I got my development system running. What is the next step?

Customaization Notes

I guess it is time to read the customization notes again. So where to look?

So what's next?

I guess I want to see if I get the example run using newFileSystemCatalog and Factory.

I just change the classes in oaicat.properties and now tomcat log tells me:

javax.servlet.ServletException: NewFileSystemOAICatalog.maxListSize is missing from the properties file

so I change the corresponding line oaicat.properties to

NewFileSystemOAICatalog.maxListSize=100
NewFileSystemOAICatalog.homeDir=/var/lib/tomcat6/webapps/oaicat/WEB-INF/META/
NewFileRecordFactory.repositoryIdentifier=oaicat.oclc.org

Now I get a new error which doesn't tell me much:

javax.servlet.ServletException: org/apache/xpath/XPathAPI

I give up for the moment. I guess need to know more about these classes to get it working.

Logging

Another item on my todo list is logging. I don't know how logging and debug messages work. Maybe I look into it:

Your web applications should certainly use their own log4j configuration. This is valid with the above configuration. You would place a similar log4j.properties file in your web application's WEB-INF/classes directory, and log4jx.y.z.jar into WEB-INF/lib. Then specify your package level logging. This is a basic setup of log4j which does *not* require Commons-Logging, and you should consult the log4j documentation for more options. This page is intended only as a bootstrapping guide (source).

This makes it work:

  • I link log4j-1.2.jar to $CATALINA_HOME/lib 
  • I put log4j.properties in WEB-INF/classes
  • log4j.properties contains:

log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/home/maurice/NetBeansProjects/oaicat2/log/oaicat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

I took me only 24h to find this out, but at least it is done now.

No votes yet
Theme provided by Danetsoft under GPL license from Danang Probo Sayekti