Link to home
Start Free TrialLog in
Avatar of nzinsli
nzinsliFlag for United States of America

asked on

log4net localhost log file

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
Avatar of srikanthreddyn143
srikanthreddyn143

Check the path while debugging to which location your app is pointing to.
Avatar of nzinsli

ASKER

I was inspecting the object in my code trace, but wasnt able to see a file path in any of them. Any other thoughts?
I dont think windows XP checks for write permissions. If possible can you paste your log4net.config file.

Thanks.
Avatar of nzinsli

ASKER

<log4net>
		<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"/>
			</layout>
		</appender>
		<root>
			<level value="ALL"/>
			<appender-ref ref="RollingFile"/>
		</root>
	</log4net>

Open in new window

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.

Avatar of nzinsli

ASKER

Nothing I've tried is working. :(
ASKER CERTIFIED SOLUTION
Avatar of nzinsli
nzinsli
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nzinsli

ASKER

I've given up on this issue.