Using ServiceStack v4 with Elmah - servicestack

Is there any up-to-date guide that will help with integration of Elmah into ServiceStack for logging? Anything I look, like this question is out of date since methods changed.
Ideally I would like to receive error emails like described on this link, but for start I would just love to be able to go to elmah.axd and see all unhandled errors.
I've already installed Elmah and configured web.config (which I've done using NuGet). Now I'm stuck as to what to do after doing Install-Package ServiceStack.Logging.Elmah - most of old tutorials say that I need to use NLog (which I don't want to do - since I don't want multiple logging components).
Thanks for the help!

This post should cover it: http://blog.elmah.io/logging-to-elmah-io-from-servicestack/
The post explains how to integrate with the elmah.io logger, but the method is the same for other types of ErrorLog implementations for ELMAH. Instead of installing the elmah.io NuGet package, you can install the ELMAH package, which gives you a default set of configuration in your web.config using the memory error log.

Related

Azure B2C Provider in DNN

i am using B2C provider for DNN and trying to install it as extension and it's throwing error https://i.stack.imgur.com/6faW1.png
i am trying to use multiple version as well but not installed properly and using source from https://github.com/intelequia/dnn.azureadb2cprovider/releases
Please help me out.
There was an issue in the DNN manifest file that has been solved on v1.4.7 (release https://github.com/intelequia/dnn.azureadb2cprovider/releases/tag/v1.4.7). Tracking the issue at https://github.com/intelequia/dnn.azureadb2cprovider/issues/19
I wrote the answer below before seeing this: https://github.com/intelequia/dnn.azureadb2cprovider/issues/19
Perhaps this is pertinent to your question. You might want to check with Ryan Moore (moorecreative" to see if he was able to resolve the issue.
First, please bear in mind that I am not familiar with this particular extension, but it seems as if it is "just another" authentication provide for DNN.
I'm also a little confused. The error message indicates that you've already installed th Intelequia AzureB2C provider. Is that true?
You also say "I am using" and then "trying to install it as an extension." If you are using it, that means that it is already installed as an extension, so a second attempt to install it should throw an error. But, I would think that the installer should see that problem earlier in the process.
Finally, you say "i am trying to use multiple version as well." A provider should be installed only once, and that is what the error message is telling you.
Once you have installed an authentication provider you typically enable it for a portal, and it becomes part of the authentication process.
You should read the documentation carefully, and make sure that you are trying to use the provider as the developer intended.

ASP.NET Core Application Insights adaptive sampling

TL;DR: Does ExcludedTypes in Microsoft.ApplicationInsights.AspNetCore SDK default to Exception and Trace?
I am running an ASP.NET Core 2.2 app with version 2.6.1 Microsoft.ApplicationInsights.AspNetCore SDK. I am reading: https://learn.microsoft.com/en-us/azure/azure-monitor/app/sampling#configuring-adaptive-sampling-for-aspnet-applications where they write that the default values for ExcludedTypes is Trace and Exception, which is just the way i like it, but I am wondering, since the default values is for ASP.NET (actually specified in the application insights config for the host), if these default values also apply for ASP.NET Core applications that doesnt have an application insights config file (all config is done through code).
I know that the SDK is open sourced, but I haven't been able to search through it and find the initial values: https://github.com/microsoft/ApplicationInsights-aspnetcore. Maybe I am just searching for the wrong things.
Update:
Yes, the default ExcludedTypes for asp.net core is Event. There'are 2 places mentionded that:
1.In this article, it says "In ASP.NET Core, exact same default behavior is enabled in code.":
2.In the source code, you can find it's defined here:
First, the default values for ExcludedTypes is not Trace and Exception, it is Event. There is a GitHub issue for that. And I also tested it myself, the default ExcludedType is Event indeed.
For asp.net core, the default ExcludedType should be same as asp.net, you can take a look at this section of the article you provided. I'll try to go through the code to find out what's in the code for asp.net core and will update you later.

ELMAH for asp.net core

I am working on asp.net core webapp hosted on azure and I want to write my Elmah logs to my azure table storage .Many of the examples I looked into are using "API_KEY" and "logbucketId" but I am not sure what they are.
For instance as per elmah docs here https://docs.elmah.io/logging-to-elmah-io-from-aspnet-core/
app.UseElmahIo(
"API_KEY",
new Guid("LOG_ID"),
After installing nuget package, I don't see any API_KEY or LogBucketId in my appsettings.json file.
Where I can find my API_KEY and LogBucket_Id ?
https://github.com/ElmahCore/ElmahCore supports .net core now.
It is not based on Modules or Handlers, but Middleware.
It works fine although still limited.
The async calls are not being used at the moment. But it is quite extensible.
ELMAH doesn't work with ASP.NET Core, since ASP.NET Core doesn't work with HttpModules and HttpHandlers (ELMAH stands for Error Logging Modules And Handlers). ASP.NET Core does include a new (pre-release) diagnostic tool called ELM (Error Logging Middleware - creative, right?). You can find its source and samples here:
https://github.com/aspnet/Diagnostics/tree/release/1.1/src/Microsoft.AspNetCore.Diagnostics.Elm
Another option similar to ELMAH (and ELM) but with more capabilities is Glimpse:
http://getglimpse.com/
I realize neither of these directly answers your question but hopefully you'll find one or both of these alternative tools useful.
You can check ELMAH port to Net.Core version
https://github.com/ElmahCore/ElmahCore
Make sure it is matching your expectation before you use it.
Note: This new extension is in development and doesn't support all Elmah features.
ELMAH doesn't support ASP.NET Core. The documentation you are linking to is from elmah.io. While they have similar names and elmah.io uses ELMAH for some of its integrations, they don't share code or documentation.

Umbraco DotNetOpenAuth log4net

In an Umbraco v6.1.6 I'm trying to get log messages from DotNetOpenAuth. Umbraco already comes with log4net, version 1.2.11.0 without a public key token. The Umbraco logs work fine, but I see no messages from DotNetOpenAuth. I also tried to add a second log4net.dll assembly, the one signed with the public key 669e0ddf0bb1aa2a, while also keeping the non signed one, but to no avail. Any ideas what could go wrong?
I have exactly the same setup and tried all manner of web.config redirects and log4net versions to no avail. The problem is Umbraco is built with an unsigned version of log4net. You have a few options here:
Try to get dotnetopenauth to use trace logging. It will default to this when it can't load log4net. I had problems determining if the trace logging was actually working or not.
Build your own version of dotnetopenauth - at least you'll be able to debug. Follow these instructions

Plugin registration tool throwing Unable to load plug-in assembly

I'm using the latest version of the MS CRM 2011 SDK and am trying to deploy a custom workflow activity (it has been signed with a key). The plugin registration tool throws an error "Unable to load plug-in assembly" without much information about the root cause.
The error trace thrown by the tool is very similar to the one described in this post
The answer to the post referenced above indicates adding Microsoft.Xrm.Client assembly in the GAC, but my workflow project references the following DLLs
1)Microsoft.Crm.Sdk.Proxy.dll
2)Microsoft.Xrm.Sdk.dll
3)Microsoft.Xrm.Client.dll
4)Microsoft.Xrm.Sdk.Workflow.dll
Should all these be added to the GAC?
The CRM server is Win 2K8R2. I tried dragging and dropping the assemblies to the c:\windows\assembly folder but that did not work. No errors but nothing was copied over either. I followed the instructions outlined in this post but that did not work either.
What am I missing?
I don't think you should have to place any crm dlls into the gac, they are already installed in the CRM server files. If you think it might solve the problem use gacutil (not clear if you can't install to the gac, or if that didn't fix the problem).
I suspect its complaining about your dll, are you trying to register to the disk? As you usually have to place the dll in the crm/server/bin folder first. Try deploying to the database - makes life easier for deploying the solution to other servers later.
If that still doesn't work post the trace of the error.
Turn on crm server side.tracing. You'll get much better error information. Use the CRM diagnostic tool to turn on trace logging: http://crmdiagtool2011.codeplex.com
Turns out that if you use the /codecustomization switch to have the code generator derive from "CrmOrganizationcContext", you need "microsoft.xrm.client.dll". This DLL is not included in the default install of CRM and you need to get this on the server one wa or another.
I decided against using the /codecustomization switch which causes the "context" to derive from "OrganizationContext" instead and not take a dependency on that DLL. Plugin registration now works! This post provides more insight

Resources