How do I write to the application window log with MVC - model-view-controller

I have a simple MVC application that sometimes fails in production. I would like to write a message to the log that I can view with server manager. It seems like a simple thing to do but I've not found any reference to others doing it.
Can someone please help. I'm stuck "-(
Marie

http://msdn.microsoft.com/en-us/library/6w20x90k.aspx
System.Diagnostices.Eventlog.WriteEntry("Application", "your message here");

Related

Reporting to Sentry to proof that it's working, like on start up?

We are using Sentry for finding some errors.
How do you proof, that a reporting is working?
I had a Spring-Boot project, which was not sending any error to Sentry, so it looks like it was working without an error, but I saw in Kibana, that there have been errors.
So, my configuration was wrong. After fixing the setup, it's now sending the errors to Sentry too.
Is there any way to proof that the sending to Sentry is working?
Something like on startup of my Spring-Boot application sending a first string?
I found 2 possible solutions which both sucks, so that's why I ask for a more professional way:
I can make just on application start up a log.error("sentry is working")
I can set the log-level from warning / error to info just to see that it's working and if see it in Sentry, you change it back?
But as i mentioned, both methods are not good, so let me know how you are resolving problems like this
are unprofessional to me, so let me know
There isn't a real "answer" here currently, as part of Sentry's simplicity is it doesn't do anything until an error happens. One potential solution is to introduce a path like example.com/500 that deliberately errors.

503 error while trying to access my first RESTful web service

i just created a RESTful web service following this tutorial , when i try to test it i get a 503 error, i read somewhere that i have to set up the apex_listener by running the apex_rest_config.sql file, I did so but i get a got these errors seing how i'm working with oracle12c, i think the errors are due to the new common and local users thing, so whats to do ? and what are the actual steps to follow ?
thank you
You would need to correct the defaults.xml db.servicename entry and remove the other edits that you have done to the other files.
Please have a look here

Login fails and getting Runtime Error when submitting password of a specific pattern

I am using ASP.NET MVC for a project, Everything works fine. Recently someone reported that if he tried to login to the interface with this password J&Mg<in5 the interface showed error page I mean not even the custom 500 error page which we have configured and works otherwise.
I have elmah configured on this project, no error is shown there too.
I little more investigation showed that all password of type, examples below
<ee
<fd
<reee
i.e "<" followed by any character gave this error.
Why is this error coming, and how to resolve this ?
I think it's the request validation that triggers in this case. Try disabling it and see if it helps. Also, try looking at the event log, it should contain a bit more useful details on the matter.
Hope this helps.

Displaying Error Page in WP7 app

Just want to check I have not missed anything obvious. There is no way to Navigate the user to a "ooops something bad has happened" page from the UnhandledException handler is there?
What is everyone else doing
I know I can "handle" the error and popup up messagebox but I would prefer a whole page offering them the oppurtunity to file a bug report.
The samples I have seen simply set the RootFrame directly but I have seen that just makes for a messy UI with what looks like a Page displayed on top of another page
TIA
Pat
If you get an UnhandledException it occurs while your applicaiton is about to be shut down. The best you can do in this situation is warn the user that something went wrong (using a messagebox or similar) but be prepared that this may not be displayed to the user for long, depending on the actual exception.
Rather than try and continue executing application functionality when an unhandled exception occurs, simply save the details of the exception. Then, when the application is next started, display a message to the user to indicate that "the last time that app ran there was a problem". You can also use this opportunity to send exception details to yourself/ your web reporting service so you can analyse the issues and fix/prevent them in a future version.
You can call RootFrame.Navigate(your errorPage) to navigate to your custom error page in the UnhandledException handler.
Basically, using a custom MessageBox to show a nice easy-going error info and providing an button to send bug report is very common. And this article is MSDN pointed out that errorinfo not be a separate page in best practice.

A web application as a logging frontend for Ruby

I was looking for a web application that hopefully catches log messages sent from Ruby programs and display them , much like the Chainsaw program (in integration with log4r). I tried to Google anything related but with no success so far. Does anybody have a suggestion ?
Thanks in advance.
There is a list of web viewers for log4j logs here. Some of them are web-based.

Resources