c# - Why does NLog stops logging -


i got annoying problem using nlog. config file simple:

<?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">  <!-- make sure set 'copy output directory' option file --> <!-- go http://nlog-project.org/wiki/configuration_file more information -->  <targets> <target name="logfile" xsi:type="file"  filename = "logfile.txt" />  </targets>  <rules>   <logger name="program" minlevel="trace" writeto="logfile" /> <logger name="traincheck" minlevel="trace" writeto="logfile" />   </rules>  </nlog> 

and have windows media player in winform "open" button. code following:

private void open_click(object sender, eventargs e)     {         openfiledialog1.multiselect = true;         openfiledialog1.initialdirectory = camera_dir;         logger.info("external file opening , playing ");          if (openfiledialog1.showdialog() == dialogresult.ok)         {                             openfiledialog1.filter = "(avi,mp3,wav,mp4,mov,wmv,mpg)   |*.avi;*.mp3;*.wav;*.mp4;*.mov;*.wmv;*.mpgn|all files|*.*";              axwindowsmediaplayer1.url = openfiledialog1.filename;          }      } 

i want when click button, openfiledialog shows out, , can choose file play, , event logged (logger.info("external file opening , playing "). process has no problem. problem successive operations ("next" button clicking, showing/hiding playlist etc) not logged anymore! (i put logger.info(...) inside every of these events)

if insert break point in other logger.info(), example inside nextbutton_click, when click "next" button program breaks @ point, nothing logged (no information written in log file). i've no idea happened after logging of open file. got idea or suggestions? thanks.

we had web api service using nlog, logging months. 1 day stops logging of sudden.

the reason administrator added new role permissions log folder , somehow removed previous permissions , nlog stopped logging.

however, learnt using below setting in nlog.config catch such silent failures

internalloglevel="error"


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -