Skip to content

Commit

Permalink
OmeroLogging : Silencing NPEs during build
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/svn/omero/trunk@5502 05709c45-44f0-0310-885b-81a1db45b4a6
  • Loading branch information
joshmoore committed Oct 17, 2009
1 parent 2cb3cf5 commit ae037c0
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 5 deletions.
5 changes: 4 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

def build_hudson():
"""
Top-level build called by hudson for testing the
Top-level build called by hudson for testing all components,
generating documentation, etc.
"""
#
# Cleaning to prevent strange hudson errors about
Expand Down Expand Up @@ -49,6 +50,8 @@ def build_hudson():

def java_omero(args):
command = [ find_java() ]
p = os.path.join( os.path.curdir, "lib", "log4j-build.xml")
command.append("-Dlog4j.configuration=%s" % p)
command.extend( calculate_memory_args() )
command.extend(["omero"])
command.extend(choose_omero_version())
Expand Down
2 changes: 2 additions & 0 deletions components/antlib/resources/lifecycle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<defineClasspath/>
<defineVariables/>
<makeDirectories/>
<copyResource file="${root.dir}/lib/log4j-build.xml"/>
<copyResource file="${root.dir}/etc/local.properties"/>
<copyResource file="${root.dir}/etc/hibernate.properties"/>
<copyResource file="${root.dir}/etc/log4j.xml"/>
Expand Down Expand Up @@ -152,6 +153,7 @@ omero.version=${omero.version}
</classpath>
<files/>
<jvmarg value="-Demma.coverage.out.file=${target.dir}/coverage.emma" />
<jvmarg value="-Dlog4j.configuration=log4j-build.xml"/>
</testng>
</sequential>
</macrodef>
Expand Down
8 changes: 6 additions & 2 deletions etc/log4j-indexing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Log configuration which is pointed to by the -Dlog4j.configuration setting in
lib/omero/java.py but can be overwritten by setting omero.blitz.xargs. This
file is periodically read during runtime, and any changes cause the log4j
etc/grid/templates.xml
This file is periodically read during runtime, and any changes cause the log4j
system to be re-configured.
Previously, pointed to by lib/omero/java.py but could be overwritten by setting
omero.blitz.xargs.
-->

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
Expand Down
8 changes: 6 additions & 2 deletions etc/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Log configuration which is pointed to by the -Dlog4j.configuration setting in
lib/omero/java.py but can be overwritten by setting omero.blitz.xargs. This
file is periodically read during runtime, and any changes cause the log4j
etc/grid/templates.xml
This file is periodically read during runtime, and any changes cause the log4j
system to be re-configured.
Previously, pointed to by lib/omero/java.py but could be overwritten by setting
omero.blitz.xargs.
-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

Expand Down
41 changes: 41 additions & 0 deletions lib/log4j-build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!--
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# $Id$
#
# Copyright 2009 Glencoe Software, Inc. All rights reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Written by: Josh Moore, josh at glencoesoftware.com
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Log configuration which is pointed to by the -Dlog4j.configuration setting in
omero.home/build.py as well as the ant scripts in omero.home/components/ant/resources.
-->

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">

<appender name="PRIMARY" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="WARN"/>
<!--
<errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%40.40c] (%10.10t) %m%n"/>
</layout>
-->
</appender>

<category name="velocity"> <priority value="FATAL"/> </category>
<category name="ome"> <priority value="WARN"/> </category>

<root>
<appender-ref ref="PRIMARY"/>
</root>

</log4j:configuration>

0 comments on commit ae037c0

Please sign in to comment.