Saving error message and stack on asp.net - asp.net

I've designed a website that works through my own PC.
I set the IIS to work with Custom Errors in case user ran into some unknown exception.
I've also added a check that the error page will e-mail me whenever it found an error.
Can I somehow get the error information (Stack and description) from the error page?

I encourages you to use Open Source library out there that provided functional need. My recommendation is ELMAH.
With a few line of settings in your web.config, you will all set. result screen looks like this.
(source: googlecode.com)

You can use ASP.NET Health monitoring.
http://msdn.microsoft.com/en-us/library/ms998306.aspx

Catch any errors that might be thrown and write them to the event log.
EventLog Logger = new EventLog();
Logger.Source = "ApplictionNme";
Logger.WriteEntry("Writing to event log.");

Related

Dynamics AX Document Services salesSalesOrder error

I have a quastion regarding document services
I just want to create salesorders through document services I just follow the straight forward procces of https://technet.microsoft.com/en-us/library/hh352313.aspx.
I made the modifications that coresponds to my system through the help of the exception log of administration panel . Now I have to face the fact that my xml file is deleted and I have no salesOrders in salestable and not a response xml into response file.
Then my next action was to debug the service...attach the proccess load the debug symbols etc....
The time that I triger the services did not hit the breakpoint in the class/method SalesSalesOrder.read but instand I get a funny error from VisualStudio which make me to feel blind , also note that does not exist any error in exception log of dynamics ax or in the batch job.
The error from VS.
"An exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' occurred in Dynamics.Ax.Application.dll854.netmodule but was not handled in user code"
Can anyone help me or face something similar at the past?
iN inbound port I should specify the company id,
then everything works fine. The reason was that the default company was empty and the new salesorders cannot passed validation.

Getting "Resource not found error" while using Azure File Sync

Facing a very strange issue.
Following this guide https://azure.microsoft.com/en-in/documentation/articles/app-service-mobile-xamarin-forms-blob-storage/ to implement File Sync in Xamarin Forms app.
The Get method in my service (GetUser, default get method in App service controller) is being called thrice & on the 3rd iteration it gives me a 404 resource not found error. First 2 iterations work fine.
This is the client call
await userTable.PullAsync(
null,
userTable.Where(x => x.Email == userEmail), false, new System.Threading.CancellationToken(), null);
If I remove the following line,
// Initialize file sync
this.client.InitializeFileSyncContext(new TodoItemFileSyncHandler(this), store);
then the code works just fine, without any errors.
I will need some time doing a sample project, meanwhile if anyone can shed some light, it will be of help.
Thanks
This won't be an answer, because there isn't enough information to go on. When you get a 404, it's because the backend returned a 404. The ideal situation is:
Turn on Diagnostic Logging in the Azure Portal for your backend
Use Fiddler to monitor the requests
When the request causes a 404, look at what is actually happening
If you are using an ASP.NET backend (and I'm assuming you are because all the File tutorials use ASP.NET), then you can set a breakpoint on the appropriate method in the backend and follow it through. You will need to deploy a debug version of your code.
this is sorted now, eventually I had to give it what it was asking for. I had to create a storage controller for User too, although I don't need one as I don't need to save any files in storage against the users.
I am testing the app further now to see if this sorts my problem completely or I need a storage controller for every entity I use in my app.
In which case it will be really odd as I don't intend to use the storage for all my entities.

How to log Error Message Contents in Rebus?

Is there anyway to log message contents when an exception occurs?
I looked at various logging extensions but they are just logging CorrelationId. And message contents are not available.
There is a CurrentMessge property in MessageContext, but that is not available at the time logger writes the exception.
I tried to handle PoisonMessage Event, which allows me to log the message contents.
public static void OnPoisonMessage(IBus bus, ReceivedTransportMessage receivedTransportMessage, Rebus.Bus.PoisonMessageInfo poisonMessageInfo) {
var message = new JsonMessageSerializer().Deserialize(receivedTransportMessage);
Log.Error("{#messageType} failed {#message}", message.Messages[0].GetType(), message);
}
This works great, but now I have two errors in the log one coming from my handler and the other coming from logger.
I am wondering if there is a better way to handle this requirement.
If your requirement is to simply log the message contents as JSON, I think you've found the right way to do it - at least that's the way I would have done it.
I'm curious though as to what problem you're solving by logging the message contents - you are aware of the fact that the failing message will end up in an error queue where you can inspect it?
If you're using MSMQ, you can inspect JSON-serialized messages using Rebus' Snoop-tool, which is a simple MSMQ inspector. It will also allow you to move the message back into the input queue where it failed ("return to source queue")
A good way to monitor your Rebus installation is to set up some kind of alerts when something arrives in an error queue, and then you can look at the message (which event includes the caught exceptions in a special header) and then resolve the situation from there.

The EventLogWebEventProvider provider failed to log an event with the error code 0x80070057

I am writing WebEvent in my asp.net Application and it is working fine in both my development and production region.However, When I analyze Event Logs in production server for past couple of months.I see below event
The following exception was thrown by the web event provider 'EventLogProvider' in the application '/(MyApplicationName)' (in an application lifetime a maximum of one exception will be logged per provider instance):
System.Web.HttpException (0x80004005): The EventLogWebEventProvider provider failed to log an event with the error code 0x80070057.
at System.Web.Management.EventLogWebEventProvider.ProcessEvent(WebBaseEvent eventRaised)
at System.Web.Management.WebBaseEvent.RaiseInternal(WebBaseEvent eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1)
Although Occurrence is very low, still I am curious to understand why this is happening.I tried to do some research and found below link
http://forums.iis.net/t/1201176.aspx?IIS+Keep+hanging
According to this link, I may be passing some invalid argument while writing event log.
But I double checked my EventLog.WriteEntry method and I am using it in my application only in couple of places and moreover, I am passing static string message. If argument is invalid then it should occur every time I try to write event.
Can anyone please help me understanding possible cause for this event.is there any known issue when working with EvenLog?
Check your code you may be trying to perform an invalid operation.
In my case i was writing a file to C Drive after changing Location to D Drive Problem Resolved

SmartTarget Errors in log file

I don't have any errors with my smart target application, but I do see in the event log, the following error messages:
ERROR 2012-09-19 14:30:09
com.tridion.smarttarget.utils.AmbientDataHelper - can't find defined
trigger-types in claim store (check if your smarttarget cartridge is
up and running)
and:
ERROR 2012-09-19 14:30:11
com.tridion.smarttarget.tags.TimeoutQueryRunner - The fredhopper query
timed out java.util.concurrent.TimeoutException at
java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) at
java.util.concurrent.FutureTask.get(Unknown Source) at
com.tridion.smarttarget.tags.TimeoutQueryRunner.executeQuery(TimeoutQueryRunner.java:64)
ERROR 2012-09-19 14:30:11
com.tridion.smarttarget.tags.TimeoutQueryRunner - The fredhopper query
timed out
I would really like to understand what is causing these and how I can remove them. Or some suggested steps to help me debug this would be great :)
As I say, everything is working perfectly, later on in the logs I see the query to ST is correct and the results being generated.
In the event that is helps, I'm running on a 2009 implementation with Smart Target 2010, java 1.5.
thanks
John
Sounds like you might have a trigger configured in ST that does not actually exist in the ADF (or is mismatched). Have you looked through your trigger-types.xml file for anything obvious? Have you disabled an ADF cartridge but not removed the corresponding trigger in the XML perhaps? See the documentation for Defining trigger types.
I think your timeout is coming from the SmartTarget region rather than FredHopper. Sometimes a query that isn't already cached in FredHopper can take a while to return, even though it's ultimately successful. The ST query tag has a timeout (defined in the smarttarget_conf.xml file, or over-ridden with a tag attribute) that it will wait for a response from Fredhopper for before resorting to using the fallback content. This might explain why you see later in the logs that the query is correct and that results are returned. See the documentation for <tcdl:query>.
No conclusive answer for you I'm afraid, but I hope that helps.
The first error is logged if your SmartTarget cartridge is not running -- or if the data that it puts into ADF is lost somehow (e.g. you have disabled sessions in your web server).
In that case, SmartTarget will still do a query but it won't include anything from the Ambient Data Framework in it. If you don't have any triggers based on ambient data, the end result is the same for you.
To get rid of the error, make sure that smarttarget_cartridge is configured correctly.
As for the timeout error, it simply means that the query sent to Fredhopper took longer than the configured time. In that case it will show the fallback content instead. If this is happening a lot, you might want to increase the timeout within smarttarget_conf.xml.
I hope you found the issue, but for future reference, the first error message is raised when the claim "taf:claim:ambientdata:definedtriggertypes" is not set by the SmartTarget cartridge. This can be caused by:
SmartTarget cartridge could not load the the trigger types from the SmartTarget server. The log will show an error "can't retrieve list of defined trigger types from FH".
The HTTP session on your web server is expired during an active visit (the HTTP session expired but the browser is still open) and the claim is "lost".
The server does not support sessions like Peter mentioned.

Resources