Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5981549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:57:34+00:00 2026-05-22T21:57:34+00:00

I have an asp.net mvc 3 application. In this application I have a reminder

  • 0

I have an asp.net mvc 3 application. In this application I have a reminder system that uses quartz to grab messages from the database and send them out.

I am wondering what is the best way to log if something happens(say the database times out – I want to know about this).

I use in my mvc application ELMAH for my logging and it works great. However since quartz.net is it’s own thread with out the httpcontext I can’t use ELMAH(or at least I don’t think I can). I tried to make an httpcontext by first querying my home page then through the scheduler code and using that as the context but that did not work.

System.ArgumentNullException was unhandled by user code
  Message=Value cannot be null.
Parameter name: application
  Source=Elmah
  ParamName=application
  StackTrace:
       at Elmah.ErrorSignal.Get(HttpApplication application)
       at Elmah.ErrorSignal.FromContext(HttpContext context)
       at Job.Execute(JobExecutionContext context) in Job.cs:line 19
       at Quartz.Core.JobRunShell.Run()
  InnerException: 

ErrorSignal.FromCurrentContext().Raise(new System.Exception());

So I am looking for either how to get ELMAH working in this scenario or something comparable to it(something that sends emails, stack trace and everything nice ELMAH has).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:57:35+00:00Added an answer on May 22, 2026 at 9:57 pm

    You can try NLog. It’s very simple to implement and effective.
    You can send email, trace pretty much everything.
    I normally tend to keep everything in a separate config file (NLog.Config)

    <?xml version="1.0" encoding="utf-8" ?>
    <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
        <targets>
            <target name="DebugHandler" type="File" filename="${basedir}/_Logs/${date:format=yyyyMMdd}_${level}.Log"
                layout="${longdate} ${logger}   ${aspnet-session:variable=UserName} ${threadid} ${environment}  ${identity} ${aspnet-request}   ${message}  ${exception}" />
            <target name="ErrorHandler" type="File" filename="${basedir}/_Logs/${date:format=yyyyMMdd}_${level}.Log"
                layout="${longdate} ${logger}   ${aspnet-session:variable=UserName} ${threadid} ${environment}  ${aspnet-request}   ${message}  ${exception}" />
            <target name="FatalHandler" type="File" filename="${basedir}/_Logs/${date:format=yyyyMMdd}_${level}.Log"
                layout="${longdate} ${logger}   ${aspnet-session:variable=UserName} ${threadid} ${environment}  ${aspnet-request}   ${message}  ${exception}" />
            <target name="GenericHandler" type="File" filename="${basedir}/_Logs/${date:format=yyyyMMdd}_${level}.Log"
                layout="${longdate} ${logger}   ${aspnet-session:variable=UserName} ${threadid} ${environment}  ${aspnet-request}   ${message}  ${exception}" />
        </targets>
        <rules>
            <logger name="*" level="Debug" appendTo="DebugHandler" />
            <logger name="*" level="Error" appendTo="ErrorHandler" />
            <logger name="*" level="Fatal" appendTo="FatalHandler" />
            <logger name="*" levels="Info,Warn" appendTo="GenericHandler" />
        </rules>
    </nlog>
    

    As you can see you can activate or deactivate the different levels.

    I’ve used it on in my quartz.net jobs as well as a debugging/tracing system and it does its job.

    The only limit is you do not have an ELMAH interface, which can be a huge limit sometimes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC application that uses jQuery 1.3.2. On several of the
I have an ASP.NET MVC application that currently uses the WebClient class to make
I have an asp.net mvc application that uses partial views. How do I know
I have an ASP.NET MVC 3 application that uses a WCF service within the
I have an ASP.NET MVC 3 application that uses the Ninject.MVC3 extension to setup
I have an asp.net mvc application that uses web service. I have various controllers
I have this ASP.NET MVC application that I now want to separate out the
This is nuts. I have an ASP.NET MVC application using Windows authentication that, amongst
I have an ASP.NET MVC 3 application. This application requests records through jQuery. jQuery
I have an ASP.NET MVC application using Authorization Attributes on Controllers and Actions. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.