Greetings,
We are using log4j 2.13.3 and a routing appender. This works correctly as desired but we would like to split routing in two files per id. Following is a snippet from my configuration file.
Essentially we are doing what can be called as a job. We want to separate out the logs for main engine, and a job. Job logs need to be separated into driver and job log and these logs need to go to a specific directory that is specific to the job. In the following scenario, logs get split correctly based on "type" set, but once route is created, it does not notice "ctx:path" change and messages are directed to only one path.
How do I configure it so that I can route based on path as well as type? <Routing name="RoutingAppender"> <Routes pattern="$${ctx:type}"> <Route key="driver"> <RollingFile name="Driver logs" fileName="${ctx:path}/driver.log" filePattern="${ctx:path}/driver.%i.log"> <PatternLayout>...</PatternLayout> </RollingFile> </Route> <Route key="job"> <RollingFile name="job logs" fileName="${ctx:path}/job.log" filePattern="${ctx:path}/job.%i.log"> <PatternLayout>...</PatternLayout> </RollingFile> </Route> <Route> <RollingFile name="default" fileName="/tmp/mainlog.log" filePattern="/tmp/mainlogs/logs/${date:yyyy-MM}/cdp-%d{yyyy-MM-dd}-%i.log"> </RollingFile> </Route> </Routes> <IdlePurgePolicy timeToLive="15" timeUnit="minutes"/> </Routing> Regards, Niranjan --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org