i have memory target , file target in nlog set this
<?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/nlog.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.nlog-project.org/schemas/nlog.xsd nlog.xsd" autoreload="true" throwexceptions="true" internalloglevel="off" internallogfile="d:\temp\nlog-internal.log"> <targets> <target name="logfile" xsi:type="file" filename="file.txt" /> <target name="memory" xsi:type="memory" layout="${level}|${time}|${message}"/> </targets> <rules> <logger name="*" minlevel="info" writeto="logfile" /> <logger name="*" minlevel="info" writeto="memory" /> </rules> </nlog>
i memorytarget in constructor this
target = (memorytarget)nlog.logmanager.configuration.findtargetbyname("memory");
after access target's logs (still in constructor) , there couple of messages. after n amount of messages nlog stops writing messages memory target. more, if try target name in beggining returns null. after time , fiddling around nlog falls outofmemoryexception. file target works fine though. how can fix memorytarget not writing logs , deleting itself?
upd: looked @ nlog internal debug log , noticed @ point targets wiped. have main program nlog config , dll one. same , should not conflict each other. internal log here http://pastebin.com/m885xmbi
so problem conflict of nlog configs. had project functions nlog in them , wpf application uses project dll. though configs same nlog read first config , set targets, read second 1 apperently failed (i don't know, there no exception in nlog inner logs) , deleted targets. removing config dll project fixed problem
Comments
Post a Comment