 |
|
 |
Hi,
I am using the Enterprise Library 5.0 Stack trace property is not available when I configure the exeption logging. Is there any way I can add this to my trace.log.
Also I need to genrate the trace.log file everyday basis. Please suggest.
Thanks
|
|
|
|
 |
|
 |
Please tell me how to do log exception to database using enterprise library configuration...
|
|
|
|
 |
|
|
 |
|
 |
At the following Step
Click on 'Distributed Settings', see Attribute settings, make DefaultCategory=trace. See figure for this.
I am not able to see Trace in the options , it is showing only General .
Please help me.
Naresh
|
|
|
|
 |
|
 |
this info must not appear in the logging. what configuration setting needs to be changed.
----------------------------------------
Timestamp: 4/25/2005 2:15:48 PM
Message: HandlingInstanceID: 3030db61-cccb-4b0b-8a3a-3661df5924db
An exception of type 'System.DivideByZeroException' occurred and was caught.
---------------------------------------------------------------------------
|
|
|
|
 |
|
 |
I have the same problem that I see in this example and that is that a web application will always show:
Process Name: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe
Does anyone know of a formatter element or any way to get the actual ProcessName (the class name) of the object in use?
--
On a related note, I would like to be able to look through the log file and see a specific users or sessions "work path". I have an app that is logging to one file but I have no way to filter out the logs specific to one users or one sessions work process.
|
|
|
|
 |
|
 |
can we do same in EL 2.0
Mahendra
|
|
|
|
 |
|
 |
May i use CustomTracelistner instead of FlatFileTraceListner.
if possible may u guide me .
Mahendra
|
|
|
|
 |
|
 |
Hi,
all is fine but i want to change file name for each and every Exception.
so how can i trap file name and path from configuration and make new file name.
Mahendra
|
|
|
|
 |
|
 |
Hi..
The post is excellent. Could you please provide similar step by step implementation for the Data Access Application Block in the Enterprise Library 2.0. It would be really appreciable.
|
|
|
|
 |
|
 |
After following the tutorial and doing
throw ExceptionPolicy.HandleException(ex, "Business Layer Policy");
I get "The type caught or thrown must be derived from System.Exception". I can't see how I can do this since I can't modify the Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy class. What can I do? Have I forgotten something?
|
|
|
|
 |
|
 |
I don't know if this is helpful at this time, but I think the problem is that ExceptionPolicy.HandleException(ex,"Business Layer Policy") returns a boolean and not an Exception, and you can't use throw with booleans. You get the same error if you write something like:
bool mybol = true;
throw mybol;
you're trying to "throw a boolean value"
|
|
|
|
 |
|
 |
try
{
// Run code.
}
catch(Exception ex)
{
bool rethrow = ExceptionPolicy.HandleException(ex, " Data Access Policy");
if (rethrow)
throw;
}
|
|
|
|
 |
|
 |
I am new to ASP.NET and was recently introduced to DAAP & then the Enterprise Library.
I started using the Data Application Block almost immediately and was looking to learn how to use the other stuff included in the Ent. Lib'ry. This was an excellent start to learning about Exception Handling. Thanks.
Another mumbaiwalla &
cricket lover.
|
|
|
|
 |
|
 |
hi like log file is made if code enters in catch block
is there something inbuilt also so that if code enters catch block a mail should also be sent to administrator in addtion of writing in a log file
or will i have to send mail myself from it
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
 |
|
 |
Great article. One question,
In its current demo all exceptions get logged to the same file. Is it possible to configure it in such a way that each of the exeption gets written to its own file?
Thanks.
|
|
|
|
 |
|
 |
I was trying to include Exception Handling & Logging Application Block for ASP.NET 2.0 web service project. Can anyone help me. It is giving me errors, though it the same configuration is working fine with 1.0 framework
- ashish
|
|
|
|
 |
|
|
 |
|
 |
Hi Santosh,
I have done exactly what you have told.My application runs fine but it is not logging error into FlatFile Error.log.
Please help me out.
Thanks,
Rohit
|
|
|
|
 |
|
 |
hi rohit
check enterprise library cofigurations
check in all tabs that u have selected flat file logging or not.
|
|
|
|
 |
|
 |
Your article is a great little introduction, thanks! But, at the end of your article you have a quick little comment:
Important: If there is Exception as 'Security' and no logging takes place, then right click on your project folder in inetpub/wwwroot/ExceptionconfigurationBlock, select Security and give full right privileges.
Actually, I would not recommend this. You have sort of skimmed over a much bigger but very important topic of security. At a minimum I would change this to say something like "grant the ASPNET account on your server all rights except "Full Control".
More detail for anyone interested:
By default, an ASP.NET web application runs under a user account with very limited privileges on the machine. It is a local machine account called "ASPNET". Being a local account it has no access rights on any other parts of your network domain (if your PC is on a network), and it will also have no rights to access files on your disk except within your web application folder.
If you, like me, don't care to place the log file in the web application folder where PERHAPS some clever hacker could get access to it (doubtful, but why risk it?), you need to configure the file to be written to another path. Therefore you need to grant the ASPNET account read and write privileges on the folder where you want the file written. However, you don't necessarily want to grant ALL privileges. If you see a checkbox called "FULL CONTROL", that means that the ASPNET account would have enough rights to grant and revoke rights on that folder. Obviously that should not be needed for your application and only offers a potential security risk.
Since you are developing ASP.NET web applications, if any of the above seems confusing to you I would strongly recommend that you do some reading on microsoft.com and learn about file access security on your operating system before messing around with it.
--JV
|
|
|
|
 |
|
 |
Hi,
Its really nice that someone talked about security issue in this article.Security is very crucial task one has to take care. you said right on this.Thats why in order to access the network files we have to include tags in web.confiq file <identity impersonate="true">.Which is why File.exist does not work for files on network.One has to set anonymous access user rights of iis with same username & password. Thanks ones again for contributing ur knowledge on this.
Happy Coding
"San"
-- modified at 0:23 Thursday 20th October, 2005
|
|
|
|
 |
|
 |
Followed above steps to log exception, I am able to log exception msg to trace.log file but i still receive this error, which looks to be while writing in event log file.
For this i tried creating a entry in registry too with this command.
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\Enterprise Library Logging]
Error Message:
StackTrace " at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) at System.Diagnostics.EventLog.SourceExists(String source, String machineName) at System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category) at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID) at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type) at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionUtility.LogHandlingException(String policyName, Exception offendingException, Exception chainException, Exception originalException) at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry.ExecuteHandlerChain(Exception ex, Guid handlingInstanceID) at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyEntry.Handle(Exception ex) at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception ex) at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception ex, String policyName, ConfigurationContext configurationContext) at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception ex, String policyName) at Inco.Crild.BLL.EquipmentTypes.UpdateEquipmentType(EquipmentType aEquipmentType) in D:\CrildNew\CrildBLL\EquipmentTypes.vb:line 90 at crild.MaintEquipmentTypes.dgrdEquipmentTypes_UpdateCommand(Object source, DataGridCommandEventArgs e) in D:\CrildNew\crild\UserControls\MaintEquipmentTypes.ascx.vb:line 86" String
Comma, ')', or a valid expression continuation expected.
|
|
|
|
 |
|
 |
it works !! how ever would it be better to declare a exception class and pass it rather than put (ex) stack trace into the log file. btw thanks for a great artical
|
|
|
|
 |
|
 |
Thanks
Happy Coding
"San"
|
|
|
|
 |