473,385 Members | 1,927 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,385 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 1394

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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.