logging

Bash: how to cleanly log processed lines of ssh/ bash output?

北慕城南 提交于 2019-12-25 03:27:11
问题 I wrote a linux bash script with tee and grep to log and timestamp the actions I take in my various ssh sessions. It works, but the logged lines are mixed together sometimes and are full of control characters. How can I properly escape control and other characters not visible in the original sessions and log each line separately? I am learning bash and the linux interface, so any other suggestions to improve the script would be extremely welcome! Here is my script (used as a wrapper for the

log select events into a separate file

半世苍凉 提交于 2019-12-25 03:19:27
问题 Folks, I am working on analytics for my web application. The application runs on Tomcat 6. I would like to take log entries from a certain logger and put them into a log file of their own. These logs will later be picked up for Map/Reduce processing. These are the steps I have taken so far: In my Java code, I have created a logger specifically for analytics events: public static final Logger s_analyticsLogger = Logger.getLogger( "com.mm.analytics" ); I log analytics events using this logger:

log vaule in excel cell

故事扮演 提交于 2019-12-25 03:12:51
问题 I have a large excel file with scripts running to collect data from various locations. One of the cells in the sheet generates a two digit number every 10th minute. I would like to collect this number in this specific cell every 10th minute and log the value in a different sheet or a log (doesn't matter which format) Right now we can just read the value as it is displayed, but we keep a log to trace the ups and downs. 回答1: Please see edited answer When you open the sheet you hit the start

Playframework quit logging after application starts, but works for Global.onStart()

自作多情 提交于 2019-12-25 03:10:35
问题 I wrote a play 2.2.1 application and I have problems with logging. I defined a logger per class in this way: import org.slf4j.LoggerFactory; import org.slf4j.Logger; public class Foo extends Controller { private static Logger logger = LoggerFactory.getLogger(Foo.class); public Result bar(){ logger.info("Bar called"); . . . } } I am not using a logger.xml . Everything perfectly works in dev mode and every class logs fine. When I run in dist mode, it stops logging after the application is

rails 4.2 can't see db queries in heroku logs even though log_level set to :debug

若如初见. 提交于 2019-12-25 02:53:34
问题 Here is a project I'm working on: https://github.com/homanchou/the_drawing_challenge I'm having trouble seeing any db queries in the server logs on heroku or even locally in the terminal when running Puma with Foreman. All I see are asset or web requests 21:54:34 web.1 | started with pid 54784 21:54:35 web.1 | [54784] Puma starting in cluster mode... 21:54:35 web.1 | [54784] * Version 2.10.2 (ruby 2.1.5-p273), codename: Robots on Comets 21:54:35 web.1 | [54784] * Min threads: 1, max threads:

Single log file for multiple webapps

感情迁移 提交于 2019-12-25 02:52:40
问题 In my tomcat there are multiple webapps deployed and they communicate with each other. Currently they all have their own log file. But when there is some issue comes from call I have to 1st check with the app to whom I made a call and check log file of respective apps involved in the call. So I want that, as all apps is deployed in same tomcat and sharing a common log4j, if a call made to any app then all logs should be in a single log file and no matters how my webapps are involved all error

How can i load my log4j.xml file which is not in classpath and it present in D drive?

天涯浪子 提交于 2019-12-25 02:48:08
问题 I want to configure logging with log4j via xml; which is present in my D drive and not on classpath. I am using Spring MVC. Below is my log4j.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out" /> <layout class="org.apache.log4j.PatternLayout"> <param name=

Changing color and output of MAMP's php error log in the terminal

本小妞迷上赌 提交于 2019-12-25 02:22:13
问题 So the first priority here is trying to change the color of the out from the php error logs in my terminal. I read in this article PHP log file color about how they were using a class to do this but I'm not quite sure where to start. Maybe the php.ini file? Also I'm using the command tail -f /Applications/MAMP PRO/MAMP PRO.app/Contents/Resources/php5.5.10.ini to output the error logs. If this is too difficult of a task to accomplish I'll let it go. I just think it'd be nice to see some kind

Logging username in log4j

狂风中的少年 提交于 2019-12-25 02:18:37
问题 I need to print username and client IP address in logs.but username is only prints for first thread using MDC in log4j.From next thread the values are printed as empty. can any one suggest how to proceed further on this . 回答1: MDC uses ThreadLocal to store values. Maybe Log4J (like Logback) uses InheritableThreadLocal which partially solves problems like yours: newly created thread inherits MDC from parent thread. I guess you are using some sort of pooling (we are rarely creating dedicated

Android; using exec(“bugreport”)

五迷三道 提交于 2019-12-25 02:15:13
问题 Is it possible to read the output of the terminal command adb #bugreport from within the application? I tried the following but I couldn't manage to get any output. Process process = Runtime.getRuntime().exec("bugreport"); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader( process.getInputStream())); // Test result Log.d(TAG, "Line: "+bufferedReader.readLine()); I know it works with exec("logcat") , but I prefer the output of bugreport as it contains more information.