How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?

I am trying to use ELMAH to log errors in my ASP.NET MVC application, however when I use the [HandleError] attribute on my controllers ELMAH doesn’t log any errors when they occur. As I am guessing its because ELMAH only logs unhandled errors and the [HandleError] attribute is handling the error so thus no need … Read more

How can I find the method that called the current method?

When logging in C#, how can I learn the name of the method that called the current method? I know all about System.Reflection.MethodBase.GetCurrentMethod(), but I want to go one step beneath this in the stack trace. I’ve considered parsing the stack trace, but I am hoping to find a cleaner more explicit way, something like … Read more

Making Python loggers output all messages to stdout in addition to log file

Is there a way to make Python logging using the logging module automatically output things to stdout in addition to the log file where they are supposed to go? For example, I’d like all calls to logger.warning, logger.critical, logger.error to go to their intended places but in addition always be copied to stdout. This is … Read more

The shortest possible output from git log containing author and date

How can I show a git log output with (at least) this information: * author * commit date * change I want it compressed to one line per log entry. What’s the shortest possible format for that? (tried –format=oneline but that does not show the date) 16 s 16 git log –pretty=format:”%h%x09%an%x09%ad%x09%s” does the job. … Read more

How do I log a Python error with debug information?

I am printing Python exception messages to a log file with logging.error: import logging try: 1/0 except ZeroDivisionError as e: logging.error(e) # ERROR:root:division by zero Is it possible to print more detailed information about the exception and the code that generated it than just the exception string? Things like line numbers or stack traces would … Read more