Hi Le 22 sept. 2015 02:36, "Jack Bounds" <[email protected]> a écrit : > > Hi TomEE guys! > > I am using log4j2 and like to add a mysql JDBC pooled appender to my > log4j2.xml configuration. > I failed to do so, and instead of reporting all the stupid stuff I tried the > last days, I got three basic questions. > > 1: Where is a good place to add a resource as the following? > > <Resource name="jdbc/LoggingDB" auth="Container" > factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" > type="javax.sql.DataSource" maxActive="100" maxIdle="30" > maxWait="10000" > username="some-name" password="some-pwd" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost/test" /> >
Looks like a tomcat resource so context.xml or server.xml but i would recommand to use tomee.xml and openejb:Resource/<id> or java:global names > 2: What would the jndiName attribute of DataSource in log4j2.xml look like > then? > > <Appenders> > <JDBC name="databaseAppender" tableName="logging"> > <DataSource jndiName="what-is-the-valid-jndi-name-of-LoggingDB" > /> > <Column name="..." /> > <Column name="..." /> > </JDBC> > </Appenders> > > 3: Do I need any further configuration in another file (like > WEB_INF/web.xml, WEB_INF/resources.xml) ? > > I am running TomEE tomee-plus-1.7.2. > > I would appreciate any help, > BR Jack > > > > -- > View this message in context: http://tomee-openejb.979440.n4.nabble.com/log4j-2-JDBC-Appender-tp4676313.html > Sent from the TomEE Users mailing list archive at Nabble.com.
