Is This Bad Practice?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngfreeforall' list.


Jay Squatrito
Hello All -

I want to keep a FileStream object cached in an
application object for central logging thoughout my
web app. Is this considered good practice or should I
be creating a new FileStream object each time my "log"
method is called?

Thanks -
Jay

=====

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

Reply to this message...
 
    
Feduke Cntr Charles R
Jay,

    This sounds like the right way to do this to me, but you also might
want to consider outputting to the EventLog if you're logging messages that
should belong there.

- Chuck

-----Original Message-----
From: Jay Squatrito [mailto:Click here to reveal e-mail address]
Sent: Thursday, August 08, 2002 1:48 PM
To: aspngfreeforall
Subject: [aspngfreeforall] Is This Bad Practice?

Hello All -

I want to keep a FileStream object cached in an
application object for central logging thoughout my
web app. Is this considered good practice or should I
be creating a new FileStream object each time my "log"
method is called?

Thanks -
Jay

=====

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

| ASP.net DOCS = http://www.aspng.com/docs
| [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/aspngfreeforall = JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP

Reply to this message...
 
    
Beattie, Barry
Is This Bad Practice?

my guess is yes. thread affinity possibly (educated guess)
what's wrong with create/destroy on each page? it's only 22bytes of RAM...

also, there can only be one instance of that object being created. if needed
twice, create 2 objects. not use one twice at the exact same time. can you
garentee that the one instance will be called by only one method at any one
time?

Barry B

-----Original Message-----
From: Jay Squatrito [mailto:Click here to reveal e-mail address]
Sent: Friday, 9 August 2002 3:48 AM
To: aspngfreeforall
Subject: [aspngfreeforall] Is This Bad Practice?

Hello All -

I want to keep a FileStream object cached in an
application object for central logging thoughout my
web app. Is this considered good practice or should I
be creating a new FileStream object each time my "log"
method is called?

Thanks -
Jay

=====

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

| ASP.net DOCS = http://www.aspng.com/docs
| [aspngfreeforall] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/aspngfreeforall = JOIN/QUIT
| news://ls.asplists.com = NEWSGROUP

Reply to this message...
 
 
System.Diagnostics.EventLog
System.IO.FileStream




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com