Alternative logging outputs

Log messages are printed to an output, typically a file or the console. In the configuration file this is configured in the <appender> elements. Here's a few examples of alternative appenders you can use. For more examples and documentation, please refer to the Log4j website .

Logging in a PostgreSQL database:

			<appender name="jdbcAppender" class="org.apache.log4j.jdbc.JDBCAppender">
			 <param name="URL" value="jdbc:postgresql:db"/>
			 <param name="Driver" value="org.postgresql.Driver"/>
			 <param name="User" value="user"/>
			 <param name="Password" value="password"/>
			 <layout class="org.apache.log4j.PatternLayout">
			  <param name="ConversionPattern"
			     value="INSERT INTO log4j (log_date,log_level,log_location,log_message) VALUES ('%d{yyyy-MM-dd}','%p','%C;%L','%m')"/>