Details
-
Question
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.3.0
-
None
-
Mac OS X 10.9
Description
It seems that the LoggerAppenderMongoDB of log4php does not require a layout, and it dose not even use any layout at least by default even if you specify a layout in the config.xml file.
my config.xml looks like:
<appender name="myConsoleAppender" class="LoggerAppenderConsole" />
<appender name="myFileAppender" class="LoggerAppenderFile">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%date %server
</layout>
<param name="file" value="myLog.log" />
</appender>
<appender name="myMongoDBAppender" class="LoggerAppenderMongoDB">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%date %server{REMOTE_ADDR}
:%server
{REMOTE_PORT} [%logger] %message%newline" />
</layout>
<param name="host" value="mongodb://xxxxx" />
<param name="port" value="xxxx" />
<param name="databaseName" value="xxxxx" />
<param name="collectionName" value="xxxx" />
</appender>
<logger name="myLogger">
<appender_ref ref="myMongoDBAppender" />
</logger>
<root>
<appender_ref ref="myFileAppender" />
</root>
Now the logs going to the file are using the specified layout, but the ones going to MongoDB are not. Have I done it wrong? Or Is it a bug? Or it is not supported yet?
Thanks a lot.