logging

Best Practices - Stored Procedure Logging

六月ゝ 毕业季﹏ 提交于 2020-01-01 01:57:05
问题 If you have a long running SP, do you log somehow its actions or just wait for this message? "Command(s) completed successfully." I assume, that there can be plenty solutions on this subject, but is there any best practice - a simple solution that is frequently used? EDIT I've found an interesting link on this subject http://weblogs.sqlteam.com/brettk/archive/2006/09/21/12391.aspx Article describes using a log table, but there's an issue The logging procedure must be executed outside of any

Is it better to use root logger or named logger in Python

蹲街弑〆低调 提交于 2020-01-01 01:44:29
问题 I am trying to figure out the best practice for using logging in python across multiple modules. I see here: http://docs.python.org/2/howto/logging#logging-from-multiple-modules on how to use the root logger to log across multiple modules. As the link points out though, you can't tell where in your application your messages come from as they all show name "root." It seems to me there are two options (this assumes my modules are NOT in a package structure, but are just a bunch of modules in

logging remove / inspect / modify handlers configured by fileConfig()

那年仲夏 提交于 2020-01-01 00:56:53
问题 How can I remove / inspect / modify handlers configured for my loggers using the fileConfig() function? For removing there is Logger.removeHandler(hdlr) method, but how do I get the handler in first place if it was configured from file? 回答1: logger.handlers contains a list with all handlers of a logger. 回答2: This code will print all the loggers and for each logger its handlers for k,v in logging.Logger.manager.loggerDict.items() : print('+ [%s] {%s} ' % (str.ljust( k, 20) , str(v.__class__)[8

Where are Kubernetes' pods logfiles?

自作多情 提交于 2019-12-31 22:40:34
问题 When I run $ kubectl logs <container> I get the logs of my pods. But where are the files for those logs? Some sources says /var/log/containers/ others says /var/lib/docker/containers/ but I couldn't find my actual application's or pod's log. 回答1: The on-disk filename comes from docker inspect $pod_name_or_sha | jq -r '.[0].LogPath' assuming the docker daemon's configuration is the default {"log-driver": "json-file"} , which is almost guaranteed to be true if kubectl logs behaves correctly.

How to configure jetty to put logs into an external file

守給你的承諾、 提交于 2019-12-31 22:34:31
问题 How to configure jetty to put its logs into an external file? Manual says that I have to put slf4j into the lib directory. What I did was: download slf4j and put slf4j-log4j12-1.7.3.jar into $JETTY_HOME$/lib . download log4j and put log4j-1.2.17.jar into $JETTY_HOME$/lib create a log4j configuration file. it's available from below: <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender"> <param name="Threshold" value="DEBUG" /> <param name="File" value="c:/app/jetty/logs

Logging with XSLT

风格不统一 提交于 2019-12-31 22:23:52
问题 How and where could I output log messages for debug and performance purposes during an XSLT transformation? I guess the simplest method is using expressions like this: <xsl:text>message text</xsl:text> here and there in the code, using xsl:value-of if needed. But this method prints the messages in a lot of places in the output file (HTML page in my case), that is where it is called, and not always in the same place (like a log file). Is this the only way or is there a better solution? Thanks!

How to debug Spring AOP

依然范特西╮ 提交于 2019-12-31 22:23:06
问题 I have a problem with Spring AOP which doesn't ties an aspect to all the methods it should (in my opinion) (see this question for more about the root problem: Spring AOP ignores some methods of Hessian Service). How can I debug, what methods and instances get combined with what aspect? Is there something like a verbose flag for spring aop, which gives that information? 回答1: There seems not to be too much logging code in the Spring AOP classes, but... In case Spring AOP decides to use Cglib to

MySQL create time and update time timestamp

可紊 提交于 2019-12-31 20:18:13
问题 I am creating some tables where I want to store the time when a record was created and when it was last updated. I thought I could have two timestamp fields where one would have the value CURRENT_TIMESTAMP and the other would have CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP . But I guess I can't do this because you can have only 1 timestamp field with a default value in a table? How would you recommend I get and store the two times? Thanks! 回答1: You can have two columns of type timestamp in

Is it possible to name the 'screen' logfile from the -L flag?

て烟熏妆下的殇ゞ 提交于 2019-12-31 18:46:51
问题 Upon running Screen with the -L flag, a file called 'screenlog.0' is created and all output written to it (which is great), but I will be running several Screen sessions and I need to identify the logs with a unique number. Is it possible to change the log file name? 回答1: You can edit your .screenrc file and add something like this: logfile /tmp/myownlog It is also answered at Specifying a log name for screen output without relying on .screenrc . 回答2: Probably the easiest way is to use the

Python logging file config KeyError: 'formatters'

梦想的初衷 提交于 2019-12-31 18:00:17
问题 I'm currently working on a python project and I set up logging using a config file. It has already worked and was logging my messages as wanted. But then, after rearranging some of the packages and modules, I only get a key error. Full Traceback: Traceback (most recent call last): File "/Volumes/Daten/Eclipse/workspace/Carputer/src/pyboard/__init__.py", line 42, in <module> logging.config.fileConfig('../logging.conf', disable_existing_loggers=False) File "/opt/local/Library/Frameworks/Python