Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7832715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:22:18+00:00 2026-06-02T12:22:18+00:00

I have added NLog to my project and in the development environment, it works

  • 0

I have added NLog to my project and in the development environment, it works fine.

I created a Setup file to deploy my application. The NLog.config file did not show up as a dependency in the Setup project. So, I added it as a file and it is present in the same directory as the exe file and App.config when deployed.

It does not do any logging. I don’t know why. Here is the config file:

<?xml version="1.0" encoding="utf-8" ?>
<?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">
  <variable name="day" value="${date:format=dd}" />
  <variable name="month" value="${date:format=MM}" />
  <variable name="year" value="${date:format=yyyy}" />  
  <variable name="verbose" value="${longdate} | ${level} | ${message} | ${exception:format=tostring,message,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method}}" />

  <targets>
    <target name="logfile" xsi:type="File" fileName="${basedir}/Logs/${year}${month}${day}.log" layout="${verbose}" />
  </targets>

  <rules>
    <logger name="*" minlevel="Error" writeTo="logfile" />
  </rules>
</nlog>

Any help would be great. Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:22:19+00:00Added an answer on June 2, 2026 at 12:22 pm

    Put your NLog configuration within the yourapp.exe.config file. Like so:

    <configuration>
       <configSections>
          <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
       </configSections>
       <nlog>
          <variable name="day" value="${date:format=dd}" />
          ...
          <targets>
             <target name="logfile" xsi:type="File" .../>
          </targets>
          <rules>
             <logger name="*" minlevel="Error" writeTo="logfile" />
         </rules>
       </nlog>
    </configuration>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added checkbox selection model to grid panel. It works fine in IE8
I have added this file in my project with the code: Language.h: @interface Language
I have added a category to my Xcode project using File > New >
I have added a new job in my hudson server which builds the project
I have added some settings to my c# application using the configuration editor. There
I have added an image to my form's resource file, myForm.resx, and I would
I have added a new file template to Aptana Studio 3.0.4 as described in
Have added the Xcode Projects for openssl.xcodeproj and sqlcipher.xcodeproj in a current project and
I have added and mediaplayer control to my c# application, and I can make
I have added the lines to the web.config to make .html files handled by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.