log4net localhost log file

Posted on 2011-04-28
Medium Priority
Last Modified: 2012-05-12
I have log4net setup on our site. Its working fine in our dev and live sites, but I cant seem to get it to work on localhost. I tried changing the file in the config to \folder\filename and also c:\path\filename. I ran thru a debug of the code, and it is going thru those sections of code w/o error. Is there folder permissions or something else that would prevent this from working locally?

Using windows xp w/ IIS 5.1
Question by:nzinsli
  • 5
  • 3
LVL 11

Expert Comment

ID: 35485506
Check the path while debugging to which location your app is pointing to.

Author Comment

ID: 35506611
I was inspecting the object in my code trace, but wasnt able to see a file path in any of them. Any other thoughts?
LVL 11

Expert Comment

ID: 35506969
I dont think windows XP checks for write permissions. If possible can you paste your log4net.config file.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 35506992
		<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
			<file value="\App_Data\Logs\BVLogs.log"/>
			<rollingStyle value="size"/>
			<appendToFile value="true"/>
			<maximumFileSize value="1GB"/>
			<maxSizeRollBackups value="2"/>
			<layout type="log4net.Layout.PatternLayout">
				<conversionPattern value="%date %level %logger - %message%newline"/>
			<level value="ALL"/>
			<appender-ref ref="RollingFile"/>

Open in new window

LVL 11

Expert Comment

ID: 35507359
Every thing looks fine except file.

file name should be like this  <file value="..\App_Data\Logs\BVLogs.log"/>

As you told you tried with "C:\..." I don think that is an issue. But try changing it to absolute path and restart your IIS.

I used log4net in windows app and out of my knowledge it should work with the above config. Give it a try restarting IIS after making changes to file.


Author Comment

ID: 35825722
Nothing I've tried is working. :(

Accepted Solution

nzinsli earned 0 total points
ID: 37938133
I've given up on this issue.

Author Closing Comment

ID: 37959988
I've given up on this issue.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question