i have project simulate 3 cranes. want log file generated each crane. i'd rather not have 3 identical appenders differ file name. i'd rather have parent logger specifies standard appender, , child loggers change file name of standard appender leave other appender properties unchanged. possible?
i know can inside program, , that's i'll end doing, i'm curious if can done in configuration file.
the configuration below not work, may give idea of want do:
<?xml version="1.0" encoding="utf-8"?> <log4net> <appender name="timedrollingappender" type="log4net.appender.rollingfileappender"> <file value="plantgenietimed.log" /> <appendtofile value="true" /> <rollingstyle value="date" /> <datepattern value="yyyymmdd" /> <layout type="log4net.layout.patternlayout"> <conversionpattern value="%date - %message%newline" /> </layout> </appender> <logger name="crane" additivity="false"> <appender-ref ref="timedrollingappender" /> <level value="debug" /> </logger> <logger name="crane.crane1"> <file value="crane1.log" /> </logger> <logger name="crane.crane2"> <file value="crane2.log" /> </logger> <logger name="crane.crane3"> <file value="crane3.log" /> </logger> <root> </root> </log4net>
Comments
Post a Comment