logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karen Goh <karenwo...@yahoo.com.INVALID>
Subject what is wrong with my logging such that Eclipse is not printing the logging in the console ?
Date Mon, 29 Jan 2018 16:29:23 GMT
Hi experts,

I have this log4j2 problem for quite so time now and hope that I can get some tips off this
group where about I have done things wrongly.

Here is below my log4j2.xml which I put it in a Resource folder at my Project in Eclipse NEON.


		<!-- Console Appender -->
		<Console name="Console" target="SYSTEM_OUT">
				pattern="%d{yyyy-MMM-dd HH:mm:ss a} [%t] %-5level %logger{36} - %msg%n" />

	        <Logger name="Business.RegisterService" level="info" additivity="false">
            <appender-ref ref="Console" level="info"/>
		<!-- Log everything in hibernate -->
		<Logger name="org.hibernate" level="info" additivity="false">
			<AppenderRef ref="Console" />

		<!-- Log SQL statements -->
		<Logger name="org.hibernate.SQL" level="debug" additivity="false">
			<AppenderRef ref="Console" />
		<!-- Log JDBC bind parameters -->
		<Logger name="org.hibernate.type.descriptor.sql" level="trace"
			<AppenderRef ref="Console" />
		<!-- Log custom packages -->
		<Logger name="util" level="debug" additivity="false">
			<AppenderRef ref="Console" />
		<Root level="debug">
			<AppenderRef ref="Console" />			

Abit about my project : dynamic annotation Java EE with hibernate and JPA.

I have also added log4j-api-2.10.0-source.jar and log4j-core-2.10.0-sources.jar in the build
path.  It is also in my m2 repository via maven.

And in one of my classes, I have put in the necessary code ;

public class tutorDAOImpl implements tutorDAO {

	private static final Logger log = LogManager.getLogger(tutorDAOImpl.class );
			log.info("Tutor object saved");
			}catch(Exception e){
				log.warn("SEVERE problem cleaning up: " + e.getMessage());

All I get is Tomcat 'log':

INFO: Starting ProtocolHandler ["ajp-nio-8009"]
Jan 30, 2018 12:24:09 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 12616 ms

I felt that I have all the things in place for the logging to be shown when I run debug server...but
no logging Infor is shown.

Furthermore, I used to be able to get this Hibernate logging shown the SQL infor etc as the
debugger step thru the programme.

Hope someone can tell me what have I forgotten to do or what has caused the console not to
show any logging details.

Thanks alot in advance.


To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message