Patrick H. Piper wrote:
I have attempted to use this appender, but can't seem to make it work. Does
anyone know the status of this contributed component? I know that I was
making connections to the database, however, the SQL was getting written to
the database.
Any help and/or suggestions are welcome.
I didn't notice any test files for this particular appender.
I don't know this appender, I've only used LoggerAppenderDb for logging
to database which can be used this way:
<appender name="test" class="LoggerAppenderDb">
<param name="dsn" value="mysql://localhost/test" />
<param name="createTable" value="true" />
<param name="table" value="log4php" />
<param name="sql" value="INSERT INTO log4php (timestamp, logger,
level, message, thread, file, line) VALUES
('%d','%c','%p','%m','%t','%F','%L')" />
</appender>
But I suppose you know that already :)
Remember that you can also use MDC to map additional data:
LoggerMDC::put('key', 'value');
And map that to a field in the database with:
%X{key}
Typically used for user name and remote address etc.
Regards,
Knut Urdalen