Using ELMAH in currently running website - asp.net

I have a asp.net website developed in asp.net 2.0 on production which is using enterprise library for keeping the log/error and saving them into the text file. Can I use ELMAH without comipling the website and read log/error via ELMAH interface?

ELMAH can be very well used without recompile, however note that if your existing logging frameworks are handling errors, then elmah may not be able to get the error since other frameworks would have taken some actions and used up the stack trace of it.

Related

How to add log tracking system to existing asp.net application

Recently I have to maintain multiple existing application that don't have a nice desire Log system.
Most of the time it will be depend on EventLog and it does not perform well if it's front-end issue.
My question is how should I add either Elmah or Log4net to existing project to
with minor effort of changing existing application.
I tried using Log4net before, but seems like to log backend issue, you will need to add in exception from backend code, which will cost alot of effort for my case
Any other tool that provide great looging and minor effort will be appreciated, too
Since both ELMAH and log4net are free tools, you also have the option of using these and logging to a local database, file, or similar. I wrote an eBook about how to do that: .NET Web Application Logging Essentials. If you would like a copy, I can provide you with one by writing me at thomas at elmah.io.
I would also like to mention, that I'm the founder of elmah.io, a cloud-based service for handling exceptions from your web apps. We support both ELMAH and log4net and the installation is extremely easy. It's a paid service, so it's up to you if you can live with the limitations of the free versions.

Can I implement Elmah like functionality now in an ASP.Net Azure application without the need for Elmah?

I would like to implement logging but would prefer just to use the Microsoft Stack. With all of the changes to diagnostics I find it difficult to keep up.
Can anyone tell me if they have removed Elmah and been able to replace it with the Microsoft Stack of diagnostics. Note my application is an ASP.NET Web API Azure worker role Web application.
Why don't you just use the diagnostics code for Windows Azure? It's super easy to add and the portal is great for viewing and analyzing logs:
http://azure.microsoft.com/en-gb/documentation/articles/web-sites-enable-diagnostic-log/

Converting Web Site to a Web App Issue

We have a very large, VB.NET solution in Visual Studio 2010 which contains an ASP.NET Web Site. The Web was originally created as a Web Site and I need to convert it to a Web App. I have attempted to convert it in Visual Studio 2010 using these sites as guidelines:
How To Convert ASP.NET Website to ASP.NET Web Application
and at Microsoft:
http://msdn.microsoft.com/en-us/library/aa983476.ASPX
Along with the Web Site, the solution consists of three class library projects that handle things such as the business logic, database calls and models, which defines the data structures as data collections when the data is returned from the database.
The solution also includes the Microsoft Enterprise Library 3.1 and the Web Deploy project, which allows me to compile the web site into its own assembly. There are also nearly a dozen classes in the App_Code folder. Well, the main one is a module, not a class.
Once I converted the web site to an app, I was able to get the solution to compile with no compilation errors. Of course, by default, the App_code folder was changed to Old_App_Code. However, when I run the app, it does not load properly.
There are a number of calls throughout the site to methods in the module from APSX pages. At this time, this is where the application is failing. I see this error in the Event Log:
Error BC30451: 'TrimTrailingZeros' is not declared. It may be inaccessible due to its protection level.
TrimTrailingZeros is a public method in the public module. If I convert the module to a class, I get hundreds of errors (more errors than the Error List can handle).
Right now, I am getting this error that’s preventing my pages to load. I have tried a number of things to get this to work.
Any suggestions on what should I do so I can get passed this?
Let me know if you have further questions.
Thanks
-Paul
Please go through the following link. It will answer your query.
http://vishaljoshi.blogspot.in/2009/07/appcode-folder-doesnt-work-with-web.html

how to do logging in asp.net application IIS?

i have a asp.net web application written about 2 years ago .It does not have any logging mechanism in it. Ideally I would like to log any errors that happen especially at the database level. I cannot afford to break the application however, and I have limited time.
I have heard about ELMAH. Is it possible to have something that doesn't talk to my code directly and just does its own thing by monitoring the server?
It was made in ASP.NET 3.5.
It has AJAX as well as heavy use of ViewState.
The application also communicates with Excel.
It is built in Visual Studio 2008 w/ SQL Server 2005 on the backend.
How do I go about deploying this website with above requirements?
Yes.
Added ELAMH to your application - it will log the errors. It's non-invasive.
Once ELMAH is added to your application it hooks into the OnError Event and captures all errors throw by your application. This is assuming that your application does not swallow the errors.
The documentation around ELMAH is through and easy to follow.
There is also log4net -
http://logging.apache.org/log4net/

Logging in ASP.NET

Is there any logger to asp.net like the System.ServiceModel.MessageLogging used in WCF?
There is health monitoring: http://msdn.microsoft.com/en-us/library/ff650305.aspx. It has a bunch of predefined events, plus you can create your own custom events for tracking purposes.
You could use log4net for this... log4net Website
Not sure what you are actually asking for. There is ASP.NET tracing and trace.axd handler to browsing traces.
After having used it myself, I'd like to suggest ELMAH:
ELMAH (Error Logging Modules and
Handlers) is an application-wide error
logging facility that is completely
pluggable. It can be dynamically added
to a running ASP.NET web application,
or even all ASP.NET web applications
on a machine, without any need for
re-compilation or re-deployment.

Resources