above code works fine with winforms application.
But in Windows service I see it is not logging, I have tried below to resolve it but no luck
1) Ensured nlog.dll and its config file are in same installation directory ie c:\prog files\company\product\
2) when above not worked Tried keeping nlog.xml also in above directory
3) I am admin into system and service scope is local system, Also started service with admin credentails
4) Create file in advance and checked if anything is logged
5) Check system\32 and 64 folder if logs are created there
6) Added system.configuration reference
7) Checked if any exception while running Nlog code by attaching service to code, all runs fine without exception
8) Eventviewer message does not show any trace for failure in Service
9) Quickwatch window while debugging shows all value properly captured in Logger instance including rules and file name/location
All above trid with no luck. Can someone please help and let me know to use Nlog in Windows service what are
steps mandatorily required to do effective logging.
I tried as you suggested, but it does not work. Same working all the way in sample winforms application. However I see I can create csv file anywhere. Looks like logging in text file not working. Let me know your advice next.