 |
|
 |
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. ---------------------------------------------------------------------------
|
| Sign In·View Thread·PermaLink | 5.00/5 |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | 1.80/5 |
|
|
|
 |
|
 |
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?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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"
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
try { // Run code. } catch(Exception ex) { bool rethrow = ExceptionPolicy.HandleException(ex, " Data Access Policy"); if (rethrow) throw; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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"
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | 1.00/5 |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | 2.25/5 |
|
|
|
 |
|
 |
hi rohit
check enterprise library cofigurations check in all tabs that u have selected flat file logging or not.
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | 2.00/5 |
|
|
|
 |
|
 |
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.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
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
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Np....any way i was wondering how to modify the message that get writen in to the log file so it would be more user friendly...is there an easy method...
or should i modify the EntLib logging ..if so where ?? Plz get back to me soon
thanks Maithree
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I want to know how can I write exception messages into Oracle 8i database table ? If possible can u send me an example. (ie. required changes in the config file, and how to call it from the *.cs files)
|
| Sign In·View Thread·PermaLink | 3.50/5 |
|
|
|
 |
|
 |
Though my Exception handler shouldn't need to access the registery on the shared remote server I'm using it is because it keeps throwing a security exception. I have parsed those XML files for anything that would require registry access - the only thing it should do is send a simple email. Do you have any ideas?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I understood how to write into trace.log.But how can I write Seperate Trace.log files per day ? Also I want to know how can I write exception messages into SQLServer Database table ?
|
| Sign In·View Thread·PermaLink | 1.11/5 |
|
|
|
 |