logging

How to rotate the tomcat localhost log?

喜欢而已 提交于 2019-12-29 04:38:27
问题 I am using tomcat 6x in a Linux system. It prints a localhost log file like localhost.2011-06-07 , localhost.2011-06-08 on a daily basis. I want to rotate the localhost when it reaches 1MB. I can rotate log files in log4j for my web apps. But this localhost log file of tomcat, I couldn't get it to rotate. Has any got a solution other than using logrotate? 回答1: Do you not want to use logrotate, or does your sys admin not allow you to? Given that restriction, I'm afraid (from what I have been

Viewing the console log in iOS7

两盒软妹~` 提交于 2019-12-29 04:14:46
问题 Prior to iOS7, if I wanted to view the output log of an app running on an iOS device, I would use one of: https://itunes.apple.com/au/app/system-console/id431158981?mt=8 https://itunes.apple.com/au/app/console/id317676250?mt=8 However, since upgrading to iOS7, both of these don't seem to be recording the log output of any app on my phone. Would this be due to a new setting on my phone? Or has iOS7 changed the way in which logging is handled such that these two apps are now broken? 回答1: We're

Viewing the console log in iOS7

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-29 04:14:11
问题 Prior to iOS7, if I wanted to view the output log of an app running on an iOS device, I would use one of: https://itunes.apple.com/au/app/system-console/id431158981?mt=8 https://itunes.apple.com/au/app/console/id317676250?mt=8 However, since upgrading to iOS7, both of these don't seem to be recording the log output of any app on my phone. Would this be due to a new setting on my phone? Or has iOS7 changed the way in which logging is handled such that these two apps are now broken? 回答1: We're

Where/what level should logging code go?

假如想象 提交于 2019-12-29 03:29:08
问题 I'm wondering where logging code should go. For example, should my repository log it's own errors? Or should I log all errors from the UI/controller? Are there any general deisgn principles about this, or does anyone have link to a good article or somesuch. 回答1: Logging and tracing is (IMO) a fine art, knowing what to log and where takes experience. I've found that the best (worst?) way of learning the art of logging is by experiencing the pain of attempting to diagnose issues with shoddy

Where/what level should logging code go?

最后都变了- 提交于 2019-12-29 03:29:07
问题 I'm wondering where logging code should go. For example, should my repository log it's own errors? Or should I log all errors from the UI/controller? Are there any general deisgn principles about this, or does anyone have link to a good article or somesuch. 回答1: Logging and tracing is (IMO) a fine art, knowing what to log and where takes experience. I've found that the best (worst?) way of learning the art of logging is by experiencing the pain of attempting to diagnose issues with shoddy

Python logging split between stdout and stderr [duplicate]

怎甘沉沦 提交于 2019-12-29 03:17:30
问题 This question already has answers here : How can INFO and DEBUG logging message be sent to stdout and higher level message to stderr (7 answers) Closed 6 years ago . Is it possible to have python logging messages which are INFO or DEBUG to go to stdout and WARNING or greater to go to stderr? 回答1: This seems to do what I want: #!/usr/bin/python import sys import logging class InfoFilter(logging.Filter): def filter(self, rec): return rec.levelno in (logging.DEBUG, logging.INFO) logger = logging

Eliminate duplicate logging in log4net

房东的猫 提交于 2019-12-29 02:47:07
问题 I have a program that makes many log4net calls to the "myprogram" loggers. It also calls other code that makes log4net calls to other loggers. I want to capture all logs higher than INFO for "myprogram" and all logs higher than WARN for everything else. This way, I get the work-in-progress messages specific to the task I'm working on, but am still notified of potentially bad things happening in the supporting code. I want this sent to both Console and a log file. I have the following log4net

Logging error to stderr and debug, info to stdout with log4j

為{幸葍}努か 提交于 2019-12-29 02:36:07
问题 I want to add logging to an application I am developing, using apache log4j. At this point I want to redirect all log messages for level INFO and lower (TRACE, DEBUG) to stdout and all other log messages from WARN and above (ERROR, FATAL) to stderr. For example: ... logger.info("Processing at some point"); // must be written to stdout logger.debug("Point x was processed"); // must be written to stdout logger.warn("Incorrect point config"); // must be written only to stderr logger.error(

Logging error to stderr and debug, info to stdout with log4j

∥☆過路亽.° 提交于 2019-12-29 02:36:07
问题 I want to add logging to an application I am developing, using apache log4j. At this point I want to redirect all log messages for level INFO and lower (TRACE, DEBUG) to stdout and all other log messages from WARN and above (ERROR, FATAL) to stderr. For example: ... logger.info("Processing at some point"); // must be written to stdout logger.debug("Point x was processed"); // must be written to stdout logger.warn("Incorrect point config"); // must be written only to stderr logger.error(

How to read files and stdout from a running Docker container

旧时模样 提交于 2019-12-29 02:32:04
问题 How would I go about starting an application in my host machine in order to read files and stdout from a running docker container? Essentially I want to do this: docker start containerid ./myapp // This app will *somehow* have access files and stdout generated by the container I just stared. How would I go about doing that? To be more specific with where I am trying to go with this; I want to read the logs and stdout of a docker container and have those logs processed somewhere else. I am