codeyu / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Modify the display name of an application #296

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Currently, the display name for my application on a shared host is:
ADD3WWW 

And the RSS feed shows the title as:
Daily digest of errors in /LM/w3svc/1939748897/root on ADD3WWW

-----

I'd like to be able to override these names, as when I start using Elmah for 
many sites, and integrate them with Google reader (or the like - case 295 takes 
precedence), it will be hard to keep track of them.

This could preferably be set by a config in the web config, if it's not set, 
the default would of course be as it is today.

Original issue reported on code.google.com by mich...@mbwarez.dk on 25 May 2012 at 10:58

GoogleCodeExporter commented 9 years ago
This is also a little like:
- Case 31
- Case 50

Original comment by mich...@mbwarez.dk on 25 May 2012 at 10:59

GoogleCodeExporter commented 9 years ago
I found the issue - I think. 

I tried the proposed solution from Case 50, which was using the SqlErrorLog. I 
however, was using XmlFileErrorLog. I checked the source, and the difference 
between the constructors of the two, is this:

            //
            // Set the application name as this implementation provides
            // per-application isolation over a single store.
            //

            string appName = Mask.NullString((string) config["applicationName"]);

            if (appName.Length > _maxAppNameLength)
            {
                throw new ApplicationException(string.Format(
                    "Application name is too long. Maximum length allowed is {0} characters.",
                    _maxAppNameLength.ToString("N0")));
            }

            ApplicationName = appName;

Maybe this should be added to the XmlFileErrorLog too?
Or perhaps the application name shouldn't be set pr. logger, but pr. 
application in stead?

Original comment by mich...@mbwarez.dk on 25 May 2012 at 11:11