logging

Effective grep of log file

前提是你 提交于 2020-01-21 16:49:35
问题 I have a log file with a lot of lines on this format: 10.87.113.12 - - [2019-12-09T11:41:07.197Z] "DELETE /page/sub1.php?id=alice HTTP/1.1" 401 275 "-" "alice/7.61.1" 10.87.113.12 - - [2019-12-09T11:41:07.197Z] "DELETE /page/sub1.php?id=alice HTTP/1.1" 401 275 "-" "alice/7.61.1" 10.87.113.12 - - [2019-12-09T11:43:51.008Z] "POST /page/sub2.php?id=alice&jw_token=07e876afdc2245b53214fff0d4763730 HTTP/1.1" 200 275 "-" "alice/7.61.1" My objective is simple: I want to output Alice's jw_token, and

Effective grep of log file

北城余情 提交于 2020-01-21 16:49:25
问题 I have a log file with a lot of lines on this format: 10.87.113.12 - - [2019-12-09T11:41:07.197Z] "DELETE /page/sub1.php?id=alice HTTP/1.1" 401 275 "-" "alice/7.61.1" 10.87.113.12 - - [2019-12-09T11:41:07.197Z] "DELETE /page/sub1.php?id=alice HTTP/1.1" 401 275 "-" "alice/7.61.1" 10.87.113.12 - - [2019-12-09T11:43:51.008Z] "POST /page/sub2.php?id=alice&jw_token=07e876afdc2245b53214fff0d4763730 HTTP/1.1" 200 275 "-" "alice/7.61.1" My objective is simple: I want to output Alice's jw_token, and

Simultaneous Logging to Console and File using Boost

社会主义新天地 提交于 2020-01-21 14:01:10
问题 I need help to initialize the boost logging framework to simultaneously log to both a named log file and also the console - (the named log file will not require periodic rotation or any of that fancy setup per many of the boost tutorials). The logging text should go to both sinks (file and console) simultaneously, however I need to format the console output slightly differently as it will be viewed by a user. I was able to get the basics of logging to 2 separate sinks working using the boost

Simultaneous Logging to Console and File using Boost

半腔热情 提交于 2020-01-21 13:59:08
问题 I need help to initialize the boost logging framework to simultaneously log to both a named log file and also the console - (the named log file will not require periodic rotation or any of that fancy setup per many of the boost tutorials). The logging text should go to both sinks (file and console) simultaneously, however I need to format the console output slightly differently as it will be viewed by a user. I was able to get the basics of logging to 2 separate sinks working using the boost

Simultaneous Logging to Console and File using Boost

我的梦境 提交于 2020-01-21 13:59:06
问题 I need help to initialize the boost logging framework to simultaneously log to both a named log file and also the console - (the named log file will not require periodic rotation or any of that fancy setup per many of the boost tutorials). The logging text should go to both sinks (file and console) simultaneously, however I need to format the console output slightly differently as it will be viewed by a user. I was able to get the basics of logging to 2 separate sinks working using the boost

Java - Need a logging package that will log the stacktrace

孤人 提交于 2020-01-21 10:39:43
问题 Is there a Logger that will easily log my stacktrace (what I get with ex.printStackTrace() )? I've searched the log4j docs and found nothing about logging the stacktrace. I can do this myself with StringWriter sw = new StringWriter(); ex.printStackTrace(new PrintWriter(sw)); String stacktrace = sw.toString(); logger.error(stacktrace); but I don't want to duplicate this code all over the place. If log4j won't do this for me is there another logging package that will log the stacktrace for me?

Glassfish 3.1.1 suddenly stopped writing to server.log

一个人想着一个人 提交于 2020-01-21 04:39:45
问题 I changed one of the log levels in the admin console, and Glassfish 3.1.1 stopped writing anything into the domain1/logs/server.log. I since reverted the change and tried restarting the server a couple times. Here's the last thing it logged: [#|2012-02-20T16:44:53.738-0800|INFO|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=46; _ThreadName=Thread-7;|com.sun.webui.jsf.component.DropDown::The current value of component form1:basicTable:rowGroup1:6:col3

Log4j2 - configuring

你说的曾经没有我的故事 提交于 2020-01-21 03:54:05
问题 I am trying to adopt Log4j2 in my new project, but I get my logs in catalina.out , and the first one is always: ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger . It seems that I have done everything according to Log4j2 docs, but still. Here is what I have actually done: added log4j-api-2.0-beta3.jar to my project created a log4j2.xml file and put it in a location that is on the classpath (currently, in /usr/local/tomcat/home/lib . In fact, I took a sample file

How do I add timestamps to individual lines of PowerShell & output?

十年热恋 提交于 2020-01-20 21:06:29
问题 How, if at all, is it possible to add timestamps to each line of an output generated by the & PowerShell operator? Example: PS H:\> $result = & ping 192.168.1.1 PS H:\> echo $result Pinging 192.168.1.1 with 32 bytes of data: Reply from 192.168.1.1: bytes=32 time=104ms TTL=250 Reply from 192.168.1.1: bytes=32 time=106ms TTL=250 Reply from 192.168.1.1: bytes=32 time=102ms TTL=250 Reply from 192.168.1.1: bytes=32 time=102ms TTL=250 Ping statistics for 192.168.1.1: Packets: Sent = 4, Received = 4

c# Best Method to create a log file

倖福魔咒の 提交于 2020-01-20 17:08:28
问题 I'm writing a tool that's going to be check the health of workstations across a network, and will fix according to the issues it finds. I want to create a log file as the app is running through its tasks / checks on each machine. I just want to get this working on a single machine for now, but in time it will be scanning 100+ machines in one go (Threaded out). What is the best way to create a log file? I was thinking of using a List<string> to build up the log file in memory and then output