logging

Weird http request found in the Node.js Express log file

≯℡__Kan透↙ 提交于 2020-01-02 05:32:08
问题 my first public Node.js based web site (with Express) went to public couple weeks ago. I routinely checked the server log and sometimes there are some weird records. Here are some examples: - - - [Sat, 19 Oct 2013 08:44:38 GMT] "GET http://www.google.com/ HTTP/1.0" 200 3539 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" 222.205.7.245 - - [Sat, 19 Oct 2013 19:54:57 GMT] "GET http://www.wikipedia.org/ HTTP/1.1" 200 3539 "-" "Mozilla/5.0 (compatible; MSIE 5.01; Win2000)" 223.94.178.192

Enable logging in spring boot actuator health check API

我与影子孤独终老i 提交于 2020-01-02 05:00:10
问题 I am using Spring boot Actuator API for the having a health check endpoint, and enabled it by : management.endpoints.web.base-path=/ management.endpoints.web.path-mapping.health=healthcheck Mentioned here Now I want to enable log in my application log file when ever the status of this above /healthcheck fails and print the entire response from this end point. What is the correct way to achieve this? 回答1: Best way is to extend the actuator endpoint with @EndpointWebExtension. You can do the

Turn off java.util.logging for a specific package programmatically

 ̄綄美尐妖づ 提交于 2020-01-02 04:50:52
问题 I am using an SDK that uses Apache CXF internally. Apache CXF uses the java.util.logging package for logging by default. I want to change the logging level from INFO to WARNING or turn it off completely. Can I do this programmatically in the main method of my application? 回答1: There is a way to do this programatically, but it's not intuitive. Changing to SLF4J or Log4J may be better if you end up needing control at a a finer level or over multiple classes The issue is that Loggers are cached

Is there a way in Log4Net or NLog (or some other logger) to output logs in an execution-stack-nested XML or JSON format?

☆樱花仙子☆ 提交于 2020-01-02 03:41:26
问题 Is there a way in Log4Net or NLog (or some other logger) to output logs in an execution-stack-nested XML or JSON format, such that if function A() calls B(7) that calls C("something") , it'll output something like: <Method name="A"> <Method name="B" params="(int) 7"> <Method name="C" params="(string) 'something'"/> </Method> </Method> or even better: <Method name="A"> <Method name="B" params="(int) 7"> <Params> <int>7</int> </Params> <Method name="C"> <Params> <string>something</string> <

Bash script log file rotation

微笑、不失礼 提交于 2020-01-02 03:12:29
问题 My bash script produces a log file. Now i'd like to implement some log file rotation. Let's say the first time it's called somelog.log , the next time it's renamed to somelog.log.1 and the new log file somelog.log . The third time the new log is somelog.log again, but somelog.log.1 is renamed to somelog.log.2 and the old somelog.log to somelog.log.1 . I would be able to grant a maximum of eg 5. Is this done before (sample script), any suggestions. I appreciate any advice. 回答1: Try this bash

how do I log requests and responses for debugging in servicestack

僤鯓⒐⒋嵵緔 提交于 2020-01-02 01:59:11
问题 I would like to log the entire request & response pair for a servicestack webservice. I've looked at the response filer, however the stream exposed is read only. 回答1: Have you seen ServiceStack's built-in Request Logger Plugin? It's a configurable in-memory Request Logger that maintains a log / (error responses) of the recent requests. If you would like a different behaviour, you can implement and register your own IRequestLogger, it gets called for every request. It's log method gets called

How to limit stdout.log file size when running Apache Tomcat as Windows service?

人盡茶涼 提交于 2020-01-02 01:26:46
问题 Is there any way that I could limit the size of the stdout.log file in Apache Tomcat? When running as a service system.out statements go to the stdout file. But I need to have a mechanism where I can control the size of the stdout log file by creating new files after reaching 2GB size or something like that. As of now a new file is created everyday but that is not sufficient. 回答1: In Windows you can go to go to Program Files\Apache Software Foundation\Tomcat6.0\bin and run tomcat6w.exe as

SLF4J: Class path contains multiple SLF4J bindings. message printed on console

自闭症网瘾萝莉.ら 提交于 2020-01-02 01:18:12
问题 I want to print logs on console and also write them in a file. In my scala project using akka loggers here is my build.sbt libraryDependencies ++= Seq("org.mongodb" %% "casbah" % "2.8.0", "org.slf4j" % "slf4j-simple" % "1.7.12", "org.elasticsearch" % "elasticsearch" % "1.5.0", "org.scalatest" %% "scalatest" % "2.2.1" % "test" withSources() withJavadoc(), "org.easymock" % "easymock" % "3.1" withSources() withJavadoc(), "org.mockito" % "mockito-all" % "1.9.5", "com.typesafe.akka" %% "akka-actor

Intercept Log Messages slf4j

☆樱花仙子☆ 提交于 2020-01-02 01:05:16
问题 I have an application which uses slf4j as the logging facade. Now I would like to intercept all the error messages before the transfer is handed out to the underlying logging system. Is it possible to do that for slf4j? I looked through the documentation and see that we can change the Appenders in the implementation (like log4j) to achieve this but can we do this at the facade level itself? The intercept does basic stuff like incrementing a global counter for the number of error messages etc.

Heroku logs for Django projects missing errors

老子叫甜甜 提交于 2020-01-02 00:56:14
问题 I'm running a simple Django project on Heroku. It works, but if I get a server error it doesn't give me any details in the logs. This makes errors incredibly hard to deal with. Now I've set up a staging server and it has the same problem - the pages are failing and I don't get any feedback as to why. $ heroku logs ... 2012-08-08T13:55:58+00:00 app[web.1]: Development server is running at http://0.0.0.0:59048/ 2012-08-08T13:55:59+00:00 heroku[web.1]: State changed from starting to up 2012-08