473,466 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1395

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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.