You can translate the question and the replies:

Separate logs by database

Is there a way to change the log4j settings so that each database gets its own log on a Denodo server? I know there are wrappers that can read log files and probably filter these out, but I wanted to see if there was another way to do it. So Ideally I'd like to see this under the logs directory: vdp-admin.log vdp-database1.log vdp-database2.log Possible?
user
10-12-2014 14:16:21 -0500
code

1 Answer

Hi! Currently you can add a filter chain in to modify your vdp-queries.log file. This is the only file where the database is shown in each log trace. Taking into consideration my comments above, you could create a "vdp-queries.log" file per database as follows: 1. Create the appender using StringMatchFilter and DenyAllFilter: <appender name="QUERIESOUTDB1" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="$DENODO_HOME/logs/vdp/vdp-db1queries${vdp.instance.log}.log" /> <param name= "Append" value= "true " /> <param name= "MaxFileSize" value= "10MB " /> <param name= "MaxBackupIndex" value= "7" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-4r [%t] %d{yyyyMMddHHmmssSSS} %x -\t%m %n"/> </layout> <filter class="org.apache.log4j.varia.StringMatchFilter"> <param name="StringToMatch" value="mydatabase1" /> <param name="AcceptOnMatch" value="true" /> </filter> <filter class="org.apache.log4j.varia.DenyAllFilter"/> </appender> StringMatchFilter filter will accept all traces which contain "mydatabase1" value if AcceptOnMatch= true. If AcceptOnMatch = false, will filter the matching traces. If the trace does not contain "mydatabase1", the default behaviour is to accept the trace. Therefore, we need to include the DenyAllFilter to filter everythig except the traces with "mydatabase1". 2. Include the appender in the appropriate logger: <logger name="com.denodo.vdb.management.mbeans.request.RequestsManagementInfo" additivity="false"> <level value="debug"/> <appender-ref ref="QUERIESOUTDB1" /> </logger> You can find more information in https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/spi/Filter.html. Hope this helps! Regards.
Denodo Team
11-12-2014 05:42:28 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here