-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

John,

On 1/25/14, 2:32 PM, John Cartwright - NOAA Federal wrote:
> I have a simple program which uses embedded-tomcat (7.0.50) to host
> a WAR file.  The webapp is using log4j and logs correctly when run
> inside a standard tomcat container.  However, when hosted by the
> embedded-tomcat, the log4j configuration does not appear to be
> found.
> 
> I'm specifying a System property of log4j.configuration, e.g.
> 
> java -Dlog4j.configuration=/tmp/log4j.properties -jar 
> target/webapp-runner.jar /tmp/quickstart.war

Are you running one and only one webapp in your Tomcat instance? If
not, then the system property will override it for all webapps, which
will probably cause confusion (especially if log4j.jar is in the
webapp's WEB-INF/lib directory, since log4j will be initialized more
than once).

> I've ensured that the tomcat-embed-logging-log4j dependency is in
> the class path during execution.

Where exactly in the "class path"?

> Any ideas on what I'm doing wrong here?

How are you initializing log4j itself? In a ServletContextListener or
something similar? Do you manually call "new PropertyConfiguration()"
or something like that? If so, why not simply put log4j.properties
into WEB-INF/classes and remove the system property? I think that will
simplify things and likely work better.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJS5rZCAAoJEBzwKT+lPKRYI3wP/0G4vVvkLLhTOcnMR8gfKN43
whW3Y8tAxOYIHQa44b6jKyjYR4Vt/Or8ekse/JmOoEXIGljQ+4jSe8kCZwVmkCAx
OUkSCJPmgUDX9Qyy3ePETFepY+g1QHoM57GHYtUhMk+3nuqtGFQ3eGaMWNlTjBeA
DVqQKSNGdm7o69fejvUomJrmFeKM3pSsh+YEJlMOsh5WICxXsHKVlpJjNfZxB3GK
Y9dTV+/gFGuWKCmdqGhDm+VyrffV7ooymDHbZWYkm+3LVPQL1qolLWiACmmUaare
YgGwTFUpvr9iyGAsxhHtsJc9GU/IukcnRMB+ahUfVwSRRI1jpTv1ywNmlbo5uZw8
Ncw9Bi75psUwyIrgYlgVHN9fT1rxd/pyhtLs2Ff6Td/KVIcHkkSXAZimp3MhJ6rg
kaNzswEHvKps8ilXZgNKlHe+3+IY+sSIn8tvL9MAIpd3EqjXXAOPUnjbO2Q/2NcO
UEwwdW0eQNCV4KmhSqDDKVxtAAhcFMveU2+KboogeJ34oRPIQVlvwlV0bIZvmKCy
SZCTnQDQNhmgUE7qoWB5dNehD6wVWYXprFgxuAjSoMZbtXI8uf6M7FEol7A0v6Us
DcaxDmAjRY1TdrkgHuxi8GwbL9/WoIWWXN/S1dckbHnALvfmUfIUSRaqJ3GVCihP
xTjC/+hsOS0bvndRNbDB
=rWJL
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to