473,403 Members | 2,366 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,403 software developers and data experts.

Logging to file from an asp.net application: how to???

Hello,

I'd like to log to a file from an asp.net application but it seems that the
user under which asp.net applications run has very limited permissions.
Apart giving the user greater permissions, is there any other solution to
allow logging to file system???

Also I'd like to write to the bin or root asp.net application folder, how do
I get this folder dynamically from the application itself???

Bob Rock

Nov 18 '05 #1
4 1352
On Mon, 14 Jun 2004 20:50:30 +0200, Bob Rock
<no***************************@hotmail.com> wrote:
Hello,

I'd like to log to a file from an asp.net application but it seems that
the
user under which asp.net applications run has very limited permissions.
Apart giving the user greater permissions, is there any other solution to
allow logging to file system???

Also I'd like to write to the bin or root asp.net application folder,
how do
I get this folder dynamically from the application itself???

Bob Rock


Either write to one of your web app's folders (recommended), or give the
aspnet user write access to whatever folder you are going to write to. To
find a local folder's path, use Server.MapPath("./bin"), etc.

May I also recommend using log4net for logging? It's synonymous to Java's
log4j, and works pretty well OOTB. So you don't have to write a bunch of
logging infrastructure.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 18 '05 #2
Bob,

Recently there was an article in Visual Studio.Net Magazine on how to
impersonate a user selectively for say, writing to a file.

I think it's what you need. You can find the article here:

http://www.fawcette.com/vsm/2004_05/...ne/columns/qa/

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Bob Rock" <no***************************@hotmail.com> wrote in message
news:eH**************@TK2MSFTNGP12.phx.gbl...
Hello,

I'd like to log to a file from an asp.net application but it seems that the user under which asp.net applications run has very limited permissions.
Apart giving the user greater permissions, is there any other solution to
allow logging to file system???

Also I'd like to write to the bin or root asp.net application folder, how do I get this folder dynamically from the application itself???

Bob Rock

Nov 18 '05 #3
Bob Rock wrote:
Hello,

I'd like to log to a file from an asp.net application but it seems that the
user under which asp.net applications run has very limited permissions.
Apart giving the user greater permissions, is there any other solution to
allow logging to file system???

Also I'd like to write to the bin or root asp.net application folder, how do
I get this folder dynamically from the application itself???

Bob Rock

To get the virtual root path try HttpRequest.ApplicationPath this will
provide the http:// path and not the d:\InetPub\wwwroot\myapplication.

You may also try Request.ApplicationPath it has been a few days since I
did this and I'm not for sure which I used!:-)
Marty U.
Nov 18 '05 #4
Hi,

Just don't write to your app bin folder. Changes in bin folder files
monitor and cause application to restart.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)52-8888377
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #5

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

Similar topics

5
by: Ravi Shankar | last post by:
Hi all, I have an enterprise application. I am using Apache Log4J for the logging purposes. WHen a request is received by the application, it goes throug servlets and many classes, and the...
0
by: Joe Bloggs | last post by:
Hi all, I take the pleasure to inform that Dotnet Commons Logging has been released for use. Dotnet Commons Logging, a subproject of the Donet Commons project currently located under the...
6
by: Burkhard Schultheis | last post by:
As I wrote last week, we have a problem with a DB2 V8 on Linux. Here is what is in db2diag.log during online backup: Starting a full database backup. 2004-04-01-02.33.54.760164 ...
3
by: Karuppasamy | last post by:
Hi I am trying to use the Logging Module provided by Microsoft Application Blocks for .Net . I installed everything as per the Instructions given in the 'Development Using the Logging Block'. ...
16
by: Einar Høst | last post by:
Hi, I'm getting into the Trace-functionality in .NET, using it to provide some much-needed logging across dlls in the project we're working on. However, being a newbie, I'm wondering if some...
12
by: Tekkaman | last post by:
I'm getting a strange behaviour from the "pathname" and "lineno" formatter mapping keys. Instead of my file and my line number I get: /usr/lib/python2.4/logging/__init__.py as the file, and...
10
by: jaleel | last post by:
Hi , i would like to reopen the issue in the post http://www.gamedev.net/community/forums/topic.asp?topic_id=418791. My scenario is like this: 1. A web application is there (being created by...
17
by: Cramer | last post by:
I plan to implement an exception logging feature in an ASP.NET Web application that writes encountered exceptions to disk. The exception data will be stored as XML. I am planning on having each...
4
by: Alexandru Mosoi | last post by:
why doesn't logging throw any exception when it should? how do I configure logging to throw exceptions? .... logging.fatal('asdf %d', '123') .... except: .... print 'this line is never...
1
by: arunairs | last post by:
Hi, Using the EnterpriseLibrary 4.0, is it possible to Log the method name in the log file. I have it cofigured thus: <loggingConfiguration name="Logging Application Block"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.