473,320 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

log4net - catching file access problems

I am running into a problem with log4net when the logfile being
written to is locked (by someone else).

Specifically, this can occasionally happen when my application is
starting up - at startup time, the file is locked, and log4net cannot
open it. It appears that log4net tries to access the file prior to
Main(). If it cannot open the file, I'm seeing an exception thrown,
but then processing continues - just without any logging.

The problem is that the exception is thrown before Main() starts, so I
don't seem to have any way of catching it.

The fact that the file is locked is not an issue - or at least, not
what I'm trying to solve here. What I am trying to do is detect this
situation programmatically - but I can't seem to find any way of doing
that?

And a follow-up question - if there is a way of detecting the problem,
is there any way of programmatically telling log4net to try again
(after some code executes that should cause the file to become
unlocked)?

Thanks,
Ethan
Nov 16 '05 #1
0 1390

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jerry | last post by:
Hello All: Recently I am experiencing problems with my PHP scripts not being able to access remote files. I receive the following errors: Warning: file(): URL file-access is disabled in the...
3
by: Petter Holmström | last post by:
Hello, I have a problem with file access which I believe is caused by a thread-problem. I first noticed it while trying to get PSP/Mod_Python to work in the shape of an exception claiming that...
13
by: John Howard | last post by:
I have the following in a jythonc program to be executed in a html file. f1 = open("filename","r") I get message about filePermission read error. Program compiles and jar file is created....
0
by: Ethan Shayne | last post by:
I am running into a problem with log4net when the logfile being written to is locked (by someone else). Specifically, this can occasionally happen when my application is starting up - at startup...
6
by: Jakob Bieling | last post by:
Hi, I was wondering why there are file access modes, which you have to specify when opening the file. I am specifically talking about the 'read', 'read-write' and 'write' distinction. As far as...
6
by: Cable | last post by:
Hello, I am hoping that someone can answer a question or two regarding file access. I have created an app that reads an image from a file then displays it (using OpenGL). It works well using...
4
by: Jason Hurder | last post by:
Hello folks, I am experiencing a rather strange problem. I have written a service that attempts to open a file on a network share via a FileStream object. When I try to open the file from my...
1
by: Duffman | last post by:
Hi, I have what seems to be a common problem, but the solutions I've found don't seem to work. I would like to use a web service to create a file at a UNC location in a shared file. Currently...
7
by: Hercule POIROT | last post by:
Hello ! Could you please write for me the simplest portable c program that handles 64 bit file access. I want to use only high-level functions (of section 3 : libraries) from glibc/libc6. ...
2
by: hayz | last post by:
Flash sound file looping problems hello there I'm definitely a newb so please bare some patience. I have a flash sound file on the index page of a site i'm working on. First off i need the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.