Hi,
Is there any best practice guidelines or examples for threadsafe logging? I
have to write an auditlogging class for a website. The auditlog will be
stored in files on the local filesystem. A new file file is created by the
interval of 24 hours.
/m 5 2819
"martin" <ma****@discuss ions.microsoft. com> wrote in message
news:3B******** *************** ***********@mic rosoft.com... Hi,
Is there any best practice guidelines or examples for threadsafe logging? I have to write an auditlogging class for a website. The auditlog will be stored in files on the local filesystem. A new file file is created by the interval of 24 hours.
You can't use the Windows event log?
John Saunders
No, I don't want to log events, I need a complete auditlog.
"John Saunders" wrote: "martin" <ma****@discuss ions.microsoft. com> wrote in message news:3B******** *************** ***********@mic rosoft.com... Hi,
Is there any best practice guidelines or examples for threadsafe logging? I have to write an auditlogging class for a website. The auditlog will be stored in files on the local filesystem. A new file file is created by the interval of 24 hours.
You can't use the Windows event log?
John Saunders
"martin" <ma****@discuss ions.microsoft. com> wrote in message
news:E1******** *************** ***********@mic rosoft.com... No, I don't want to log events, I need a complete auditlog.
Ok, though I presume you're aware that it's possible to create custom event
logs, so that your audit entries would be the only thing in your custom log.
Otherwise, perhaps you should consider a database.
I don't think you're going to find a single best practice on this,
especially since you haven't been very specific about your requirements.
John Saunders
As I wrote in my first question the auditlog must be stored in files on the
local filesystem. I need a thread safe way to write to a file from a website.
Quite simple question I think. I can read in the SDK how to write to a file
thread safe, but I'm lokking for best practice and/or design guidelines for
the best implementation.
/m
"John Saunders" wrote: "martin" <ma****@discuss ions.microsoft. com> wrote in message news:E1******** *************** ***********@mic rosoft.com... No, I don't want to log events, I need a complete auditlog.
Ok, though I presume you're aware that it's possible to create custom event logs, so that your audit entries would be the only thing in your custom log.
Otherwise, perhaps you should consider a database.
I don't think you're going to find a single best practice on this, especially since you haven't been very specific about your requirements.
John Saunders
"martin" <ma****@discuss ions.microsoft. com> wrote in message
news:74******** *************** ***********@mic rosoft.com... As I wrote in my first question the auditlog must be stored in files on the local filesystem. I need a thread safe way to write to a file from a website. Quite simple question I think. I can read in the SDK how to write to a file thread safe, but I'm lokking for best practice and/or design guidelines for the best implementation.
See, this is what I'm getting at. There's nothing inherently different about
writing to a file with respect to thread-safety. The same techniques you'd
use for doing anything in a thread-safe manner apply to writing to a file.
John Saunders This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jeff Schwab |
last post by:
Is it OK for multiple threads to use the same PrintWriter concurrently?
|
by: Sandy |
last post by:
Hello -
I read an interesting article on the web wherein the author states he
doesn't handle too many errors at page level, but handles them at the
application level. He further goes on to show how error logging can be
incorporated using a Sql Server log with an additional text log in case Sql
Server was down.
My inclination after reading the article is to use Try-Catch-Finally as
little as possible (tends to slow things if you have...
|
by: Keith G. Murphy |
last post by:
I'm trying to get a feel for what most people are doing or consider best
practice.
Given a mod_perl application talking to a PostgreSQL database on the
same host, where different users are logging onto the web server using
LDAP for authentication, do most people
1) have the web server connecting to the database using its own user
account (possibly through ident), and controlling access to different
database entities strictly through...
|
by: martin |
last post by:
Hi,
Is there any best practice guidelines or examples for threadsafe logging? I
have to write an auditlogging class for a website. The auditlog will be
stored in files on the local filesystem. A new file file is created by the
interval of 24 hours.
/m
|
by: philip.mckee |
last post by:
Hi
Looking for some very general advice. I have a classic asp content
management application which I am porting to ASP.NET. The database is
SQL server, and it is hoped that we can leverage this without
significant alterations. There is approx 30 users accessing and
managing information using the application. Currently users log on to
the system using group logins. A general connection string is used with
all communication with the...
| |
by: csgraham74 |
last post by:
Hi guys,
Basically i have been developing in dotnet for a couple of years but
ive had a few issues in regards to error handling.
For example - I have a class that i call passing in a stored procedure
and connection string as a path. My method returns a dataset. In my SP
i have an output parameter which tells me whether the SP select is
successful or not. If i get a error code passed back then i throw an
exception this then returns...
|
by: Spam Catcher |
last post by:
Hi all,
I'm accessing a synchronized Streamwriter from potentially several threads
to do some logging. Is the Flush command threadsafe too? Should I single
thread the Flush command or will the Synchronized streamwriter handle that
for me?
Thanks!
|
by: Clausen |
last post by:
Hi,
Looking for best practice - or just some "what would you do" answers :)
Scenario:
App1.dll and App2.dll are both referenceing Logging.dll. And both are
applications installed at customers.
A bugreport is filed under App1.dll about failing logs. Developer fixes the
bug which was in Logging.dll. The Logging.dll gets a version bump.
|
by: =?Utf-8?B?QmlsbHk=?= |
last post by:
asp.net 2.0 vs2005
What is best practice for exception handling on a website in vs2005?
I was going to catch errors in application on_error event, log them to the
event log, then send users to an error page. But looking at the event log,
asp.net 2.0 logs those errors anyways, with more detail than i cen get from
the exception object. So is there any point logging them to the event log, is
it jsut better to let .net do this and get the...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |