Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

For Java UDF`s and triggers the good old log4j is available at runtime. In the developement version of the block descriptor, you can find the log4j initializer, which starts up PL-J`s own loging appender. This appender implementation uses the the PL-J interfaces to send log back to the database, so your java methods log will appear in your database log file.

see: http://logging.apache.org/ for more info on Log4j API.

Please note that if your RDBMS logging level is higher, the log may not appear in the RDBMS log. Also in PostgreSQL ERROR logs are loged as WARNING, since making an ERROR log is like an exception.

Here is how it is configured by default:

Code Block
xml
<log4jinit>
	<properties>
		<!--
		The root logger is the PLJAppender, so all log categories
		not configured here will go to RDBMS (or at least try to go there)
		-->
		<property name="log4j.rootLogger" value="INFO, plj"/>
		<property name="log4j.appender.plj" value="org.pgj.tools.log4j.PLJAppender"/>
		<property name="log4j.appender.plj.layout" value="org.apache.log4j.PatternLayout"/>
		<property name="log4j.appender.plj.layout.conversionPattern" value=" %d [%t] %-5p %c{1} - %m%n"/>
	</properties>
</log4jinit>

AS you can see, if you don`t want your UDFs and triggers to send log to the database log file, you can easily override the configuration.

There will be more logging APIs integrated.

(typos, grammar)