Logging errors with Elmah and nHibernate - asp.net-mvc-3

I'm working on an Asp.Net MVC3 application and we are looking at using Elmah to do our data logging. We are using fluent nHibernate to handle all interaction with mainframe DB2 database. So any other DB provider, is not an option.
I've been doing some research on this topic and cannot find any information on how to do it. Would rewriting one of Elmah DB providers to handle interfacing be appropriate?
I'm looking for some guidance on how to start this or where to look for the guidance.

I agree with the commenters on your question. Use log4net instead of ELMAH if at all possible. NHibernate requires log4net, so it will already be present. In addition to error logging, you can log copious NHibernate stuff (in particular the SQL statements it generates), which I find very useful while building and debugging an application.
With log4net you can send log messages to an Oracle database with the AdoNetAppender.

From my understaning Elmah is implemented as a HTTP Module, and does not use a NH so you would have to write a provider (inherit from ErrorLog), look at the Oracle implemation then change the webconfig to point to your class
there is a issue open on the google project site, I would see if you can vote on this, as it would be less work for you, but you may have to wait longer
http://code.google.com/p/elmah/issues/detail?id=257

Related

How to log Dynamics CRM standard SOAP API calls?

Context
We have an on-premise CRM (8.0) application, which is integrated with different legacy systems. There are approx 20 entities which are created/updated/upserted via the standard SOAP API by the legacy systems.
Question
I would like to log all the incoming requests and responses as SOAP/XML for diagnostics reasons. How can I accomplish this task?
(Note: I know the trivial, but not exactly fit solution to have workflows for create/update on all affected entities. This seems to be not universal enough + we ultimately must log the request text and response text itself)
I haven't tried it yet, but I think it should be possible to configure the native WCF tracing for the Organization Service. This is something really easy to do (it requires to add some configuration to the web.config file) and you will be able to log any request and response. You can take a look about how to configure it here.
EDIT:
In this link you will be able to see what I've just told you working (it was done for CRM2011 but it should works in newer versions): link

oracle CRUD frontend

We have an existing system using Oracle DB and several applications working on/off it using JDBC/ODBC etc. For an additional interface for CRUD operations I am looking at a web based front-end. I dont see a whole of ideas in this areas, maybe because the ORacle DB is mostly enterprise and probably means the enterprises building their own custom apps?
Using the Oracle REST API services, build a front end using Angular/JS. This eliminates any need for oracle specific server side logic and almost ORacle independent. Are there any frameworks / opensource tools that fall in this area?
Please let me know any comments / feedback on this approach.
As far as I know there aren't really any options like this specifically for Oracle databases. You might be better off going with a desktop solution, of which there are many.
There is a web UI called "H2 Console" which claims to work with any JDBC connection. I have used this with MySql before with great success but have not tried it with Oracle.
The H2 Console application lets you access a database using a browser. This can be a H2 database, or another database that supports the JDBC API.
If you want something more 'user friendly' then as far as I know there are no existing solutions for this. You will probably have to build your own or educate your users on SQL.

What are some proven approaches to reporting startup errors in a Web API application?

I'm starting a new Web API project, and have installed Elmah. Reporting exceptions seems straight-forward in the context of HTTP requests. But what about exceptional things that happen during application startup? Elmah has a mechanism for manually logging exceptions, but is this a wise approach? I get an uneasy feeling that I'm doing something that's not recommended.
ELMAH is a great choice for logging uncaught exceptions in Web API as well as manual logging of errors. If you haven't already, you should take a look at Elmah.Contrib.WebApi, which both logs Web API errors automatically but also contains an ExceptionLogger for Web API, which will log errors during initialization as well.
With that said, ELMAH probably isn't the right tool for every logging scenario. If you want to log information, debug and verbose messages, you can combine the use of ELMAH with a log framework of your choice. I personally love Serilog, but there are other choices like log4net and NLog. All are pretty easy to install in Web API.
Actually, I wrote a blog post some months ago, where I tried to sum up the ASP.NET Error Logging Best Practices, that you can read. For more information about the diffferences between ELMAH and logging framework, I also wrote ELMAH vs log4net, which also covers other logging frameworks than log4net.

Object persistence without ORM or DB Engine

I learned to love how LINQ enables set operations on collections. I'm not saying that I plan to shun traditional RDMBS, because I do need it for reporting. There are NoSQL alternatives out there, but they seem to all need to fire up a separate service.
What I looking for is something local where a DLL can create a database and perform CRUD on it. As mentioned, I'm not going to report out of this, just internal data store. The main application that will be using it is in C#.
I'm hoping that someone can give me a lead. If not, if there is anyone willing, we can start a open-source project for it. I'm not interested in commercial products.
Thanks,
You can run RavenDB in embedded mode inside your .NET application - no need for external services or anything.
And RavenDB supports Linq....

DevExpress (DXv2) and DevArt dotConnect?

I'm writing a C# Applications Solution v11.2 using eXpressApp Framework from DevExpress and the first thing I would like to do is make the 2 apps (web & win) connect to an Oracle Database without using the Oracle Client.
In my other projects I have used DevArt's dotConnect tool, which is great by the way (works without needing any Oracle Client installed).
I wonder if someone has tried this, 'cuz I just can't get it work. From what I read from the forums, I think that eXpress Framework doesn't recognize dotConnect's OracleConnection, or that I have to write my own XPO provider.. ?!
Please help!
Thanks!
One of the approaches to accomplishing this task is to create a custom XPO connection provider. This class will be a descendant of one of the standard connection providers listed in the Database Systems Supported by XPO help topic. I believe the following KB article should helps.

Resources