logging

Can I have logging.ini file without root logger?

a 夏天 提交于 2020-12-29 06:38:28
问题 Here is how my logging.ini file looks like: [loggers] keys=teja [handlers] keys=fileHandler [formatters] keys=simpleFormatter [logger_teja] level=DEBUG handlers=fileHandler qualname=tejaLogger [handler_fileHandler] class=logging.FileHandler level=DEBUG formatter=simpleFormatter args=("error.log", "w") [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s I am getting the follwing error: File "test.py", line 22, in <module> logging.config.fileConfig('logging

Can I have logging.ini file without root logger?

微笑、不失礼 提交于 2020-12-29 06:38:12
问题 Here is how my logging.ini file looks like: [loggers] keys=teja [handlers] keys=fileHandler [formatters] keys=simpleFormatter [logger_teja] level=DEBUG handlers=fileHandler qualname=tejaLogger [handler_fileHandler] class=logging.FileHandler level=DEBUG formatter=simpleFormatter args=("error.log", "w") [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s I am getting the follwing error: File "test.py", line 22, in <module> logging.config.fileConfig('logging

debug_print_backtrace() to String for log-file

大兔子大兔子 提交于 2020-12-29 05:14:39
问题 I have a problem. I would like to log the backtrace in a specific case in a log-file. debug_print_backtrace() builds a correct string for my purposes but debug_print_backtrace() prints the trace on the screen instead of returning it. 回答1: Use another function. debug_backtrace() returns an array that you can loop through, format and save: $data = debug_backtrace(); Or use output buffering for the formatted output string: ob_start(); debug_print_backtrace(); $data = ob_get_clean(); 回答2: It's

debug_print_backtrace() to String for log-file

橙三吉。 提交于 2020-12-29 05:11:02
问题 I have a problem. I would like to log the backtrace in a specific case in a log-file. debug_print_backtrace() builds a correct string for my purposes but debug_print_backtrace() prints the trace on the screen instead of returning it. 回答1: Use another function. debug_backtrace() returns an array that you can loop through, format and save: $data = debug_backtrace(); Or use output buffering for the formatted output string: ob_start(); debug_print_backtrace(); $data = ob_get_clean(); 回答2: It's

How to view history of queries (all OR over a long period) performed on database which is hosted on Azure?

独自空忆成欢 提交于 2020-12-29 00:48:07
问题 For a database hosted on Azure, i can view the recent history of the queries performed on it. This is through the Azure portal > Database > Manage > Administration > Query Performance . Unfortunately, the history found there, only covers a small time frame (few minutes). I intend to create non-clustered indexes on my database and for that, need to get a log of the real queries run on the data on a typical day, as opposed to the past few minutes. Currently, i have to keep refreshing the page

How to view history of queries (all OR over a long period) performed on database which is hosted on Azure?

白昼怎懂夜的黑 提交于 2020-12-29 00:44:42
问题 For a database hosted on Azure, i can view the recent history of the queries performed on it. This is through the Azure portal > Database > Manage > Administration > Query Performance . Unfortunately, the history found there, only covers a small time frame (few minutes). I intend to create non-clustered indexes on my database and for that, need to get a log of the real queries run on the data on a typical day, as opposed to the past few minutes. Currently, i have to keep refreshing the page

How to view history of queries (all OR over a long period) performed on database which is hosted on Azure?

*爱你&永不变心* 提交于 2020-12-29 00:43:56
问题 For a database hosted on Azure, i can view the recent history of the queries performed on it. This is through the Azure portal > Database > Manage > Administration > Query Performance . Unfortunately, the history found there, only covers a small time frame (few minutes). I intend to create non-clustered indexes on my database and for that, need to get a log of the real queries run on the data on a typical day, as opposed to the past few minutes. Currently, i have to keep refreshing the page

Showing the right funcName when wrapping logger functionality in a custom class

时间秒杀一切 提交于 2020-12-27 08:46:44
问题 This is the formatting string that I am using for logging: '%(asctime)s - %(levelname)-10s - %(funcName)s - %(message)s' But to show the logging messages I have a wrapper doing a bit more (I setup different log levels, configure different logging backends, provide convenience functions to access the custom levels, etc): class MyLogger(logging.Logger): def split_line(self, level, message): .... self.log.(level, line) def progress(self, message): self.split_line(PROGRESS, message) With this

Logging with Docker and Kubernetes. Logs more than 16k split up

我与影子孤独终老i 提交于 2020-12-27 07:15:36
问题 I am using Docker version 17.12.1-ce Kubernetes verision v1.10.11 My application prints the log in Json format to the console. One of the fields is stackTrace, which can include a huge stackTrace. The problem is that the log message is split up into two messages. So if I look at the /var/lib/docker/containers/ ... .log I see two messages. I read that this is done for security reasons, but I don't really understand what I can do with that? Should I cut my stackTrace? Or customize the size? Is

Logging with Docker and Kubernetes. Logs more than 16k split up

感情迁移 提交于 2020-12-27 07:15:13
问题 I am using Docker version 17.12.1-ce Kubernetes verision v1.10.11 My application prints the log in Json format to the console. One of the fields is stackTrace, which can include a huge stackTrace. The problem is that the log message is split up into two messages. So if I look at the /var/lib/docker/containers/ ... .log I see two messages. I read that this is done for security reasons, but I don't really understand what I can do with that? Should I cut my stackTrace? Or customize the size? Is