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

  • Home
  • SEARCH
  • 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 6653951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:19:55+00:00 2026-05-26T01:19:55+00:00

I am developing c# application, which is running as a windows service. What ever

  • 0

I am developing c# application, which is running as a windows service.
What ever transactions we are doing in the application i am writing it into log file.
A log directory is added in app.config file as below.

<add key ="LogDir" value="log" />
    <add key ="LogLevel" value="2" />

And in the c# code the above one is accessing as below.

int logLevel = Convert.ToInt32(ConfigurationManager.AppSettings["logLevel"]);
                if (logLevel > 0)
                {
                    logger = new Logger();
                    logger.TraceLevel = logLevel - 1;
                    logger.logDir = ConfigurationManager.AppSettings["logDir"];
                    logger.logFileBaseName = "touchserver";
                }

And then when any process is happening i am writing the data to the log as below.

TouchServer.Log(Logger.MessageType.Trace, 1, "Item successfully deleted");

And when i run my application in debug mode (i mean as console application) the log file will be created in the application’s debug folder and the data will write into the log file.

But my problem is that when i install my application as service the log file is not getting created in the debug folder, and i am unable to see the actions performed , in case if anything went wrong.

Please help me to find a solution in this.

And i am installing service using Installutil command.

Thanks in advance
sangita

  • 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-05-26T01:19:56+00:00Added an answer on May 26, 2026 at 1:19 am

    While you could get into why this is not working and fix the solution, overall there is no need to implement a logging component.

    There are excellent free libraries available that do this very well. log4net is very popular. It is easy to use, feature rich and efficient. Take a look at it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an AIR application which uses multiple windows. I'm running into an issue
I'm developing a PC c++ application running on windows. The application shall communicate with
I'm developing an ASP.NET application which needs Windows Authentication. I have the web.config set
I'm developing and application that runs as a Windows service. There are other components
I'm developing a Winforms application which has been running for years with an explorer
I am developing an application which needs to use a web service. Web service
I am developing a Windows forms application which connects to a piece of hardware,
I'm developing an asp.net application which has Windows Authentication enabled(anonymous access disabled). I've created
I am developing a Silverlight4 Application which has elevated permissions and is running out
I am developing a Windows CE application which uses some libraries provided by other

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.