stack-trace

How to disable Rails RoutingError stacktrace printout in Production log files?

回眸只為那壹抹淺笑 提交于 2019-12-04 18:40:17
问题 In my proudction rails app, I got all types of random attacks requesting for asp, zip and rar files. Rails rendered 404 page as expected, but my production log file is jammed with RoutingError stacktrace dump like the following. My question is: can I block URLs with certain patterns in Apache/Passenger? Or at least can I configure Rails to just log the error itself and not to print the entire stacktrace? Thanks! Processing ApplicationController#index (for 100.222.237.7 at 2011-03-22 10:59:54)

How can I capture Java exceptions, including the stack trace, from a log file using grep?

社会主义新天地 提交于 2019-12-04 18:12:59
问题 Summary I am trying to fetch logs from a log file using the grep command. However, I can match time stamps, but am not getting the full stack trace I need. Log File Sample [1/10/16 23:55:33:018 PST] 00000057 ServerObj E SECJ0373E: Exception message at com.own.ws.wim.util.UniqueNameHelper.formatUniqueName(UniqueNameHelper.java:102) at com.own.ws.wim.ProfileManager.getImpl(ProfileManager.java:1569) What I've Tried I am able to fetch log entries, but I want the stack trace as well. I've tried: $

Getting a python traceback without an exception

好久不见. 提交于 2019-12-04 17:27:09
问题 Suppose you have these modules: module1.py import module2 def a(): module1.b() def c(): print "Hi guys!" module2.py import module1 def b(): module1.c() I want a function func(a()) that produces a similar output to this: (=a traceback ?) /usr/local/lib/python2.7/dist-packages/test/module1.py 3 def a(): 4 module1.b() 1 import module1 /usr/local/lib/python2.7/dist-packages/test/module2.py 3 def b(): 4 module1.c() 1 import module2 /usr/local/lib/python2.7/dist-packages/test/module1.py 6 def c():

XCode Global Breakpoints don't show stack trace

血红的双手。 提交于 2019-12-04 17:12:48
I set up global break points from locations libobjc.A.dylib and CoreFoundation. I run my iphone app and it hits the exception. XCode stops at the breakpoint but does not show any error in the log besides: Pending breakpoint 1 - "objc_exception_throw" resolved Pending breakpoint 2 - "-[NSException raise]" resolved I click the "Continue" button on the console and I get the same indistinguishable error I received before I enabled the breakpoints. How do I get the stack trace that setting up the global breakpoints is supposed to generate? type bt or backtrace from the GDB console 来源: https:/

exception call stack truncated without any re-throwing

随声附和 提交于 2019-12-04 16:25:43
问题 I have an unusual case where I have a very simple Exception getting thrown and caught in the same method. It isn’t re-thrown (the usual kind of problem naïve programmers have). And yet its StackFrame contains only one the current method. Here’s what it looks like: at (my class).MyMethod() in C:\(my file path and line) In reality there are probably 30 methods leading up to this in the VS2010 debugger's call stack, going across half a dozen different assemblies. It seems impossible for all that

Why does backtrace not contain Objective-C symbols regardless of -rdynamic?

天大地大妈咪最大 提交于 2019-12-04 14:20:08
Update: I'm working with the GNU-runtime on Linux. The problem does not occur on MacOS with the Apple-runtime. Update 2: I compiled the GNU-runtime on MacOS and build the example with it. The error does not occur on MacOS with the GNU-runtime. I would say the problem is the glibc (since backtrace and backtrace_symbols are glibc extensions). When printing a backtrace in a GCC compiled Objective-C app using backtrace and backtrace_symbols , I don't get any Objective-C symbols. Only the filenames, addresses and C-symbols appear. I compiled with -g and linked with -rdynamic . My test app: void

Examine logs from the past with logcat?

纵然是瞬间 提交于 2019-12-04 12:49:37
I'd like to examine stack traces from the last hours. I haven't found a proper logcat command. Does Android "forget" those logs? First story: When I find an unhandled exception in my co-workers Iphone App, he connects the iphone to his computer and reads the stack trace into x-code. X-Code also visualizes the exception in a nice way. Is there a smth. similar in Android? You probably won't be able to see those logs from the past hours. Imagine that your phone stores all logs, how much space will it consume in a couple of days? So, this is what I do: I'm in the autobus, and suddenly the app I'm

Log stack trace for python warning

ε祈祈猫儿з 提交于 2019-12-04 12:45:22
问题 A package that I'm using in my python program is throwing a warning that I'd like to understand the exact cause of. I've set logging.captureWarning(True) and am capturing the warning in my logging, but still have no idea where it is coming from. How do I also log the stack trace so I can see where in my code the warning is coming from? Do I use traceback ? 回答1: It's a little hackish, but you can monkeypatch the warnings.warn method to this: import traceback import warnings def g(): warnings

How can I get a stacktrace from C++ in WinRT?

懵懂的女人 提交于 2019-12-04 12:17:32
问题 I need to get a stacktrace from a C++ application, and serialize it into a string so it can be parsed later. The only API I've heard of for this on Windows is StackWalk64, which doesn't appear to be supported. How can I get a stacktrace from C++ in a Windows Store app? 回答1: The only way I have been able to debug complex WINRT issues is to use ETW to track causality chains. While kind of tedious to setup This article (while referring to c#) highlights the method: Andrew Stasyuk. Async

HOWTO get the correct Frame Pointer of an arbitrary thread in iOS?

烈酒焚心 提交于 2019-12-04 11:55:52
Way to get the Frame Pointer On a Demo App running on iPhone 5s Device / Xcode 7, I tried to get the frame pointer of an arbitrary thread using thread_get_state , but always result in an incorrect one : - (BOOL)fillThreadState:(thread_t)thread intoMachineContext:(_STRUCT_MCONTEXT *)machineContext { mach_msg_type_number_t state_count = MACHINE_THREAD_STATE_COUNT; kern_return_t kr = thread_get_state(thread, MACHINE_THREAD_STATE, (thread_state_t)&machineContext->__ss, &state_count); if (kr != KERN_SUCCESS) { char *str = mach_error_string(kr); printf("%s\n", str); return NO; } return YES; } I read