Google App Engine - Can not find my logging messages

前端 未结 4 1024
暗喜
暗喜 2020-12-16 09:56

I can not find the results of my logging calls. To log messages I tried both:

System.out.println(\"some message\"); 

and

         


        
相关标签:
4条回答
  • 2020-12-16 10:31

    Problem has shrunk into more concrete form - App Engine "eats" info-messages, but shows others, such as error and warning messages.

    After this call I have eventually seen my info messages:

    log.setLevel(Level.INFO);
    

    But it is still not clearly - why info-messages weren't being shown. Google's manual states:

    Everything the servlet writes to the standard output stream (System.out) and standard error stream (System.err) is captured by App Engine and recorded in the application logs. Lines written to the standard output stream are logged at the "INFO" level, and lines written to the standard error stream are logged at the "WARNING" level.

    0 讨论(0)
  • 2020-12-16 10:36

    Could it be that your logging.properties is setting the default value to WARNING?

    Ours has this in our war/WEB-INF/logging.properties file:

    # Set the default logging level for all loggers to WARNING
    .level = WARNING
    
    # Default level for subpackages of 'server' will be INFO
    com.company.whatever.server.level=INFO
    
    0 讨论(0)
  • 2020-12-16 10:44

    I used to set LEVEL to SEVERE for testing

     logger.log(Level.SEVERE, "test message");
    

    It does not need changing any value in logging.properties

    0 讨论(0)
  • 2020-12-16 10:57

    Had exactly the same problem and after changing the value in logging.properties from

    .level = WARNING

    to

    .level = INFO

    The problem was definitively fixed. Google needs to update their documentation and/or change the value of the supplied default so that "INFO" log messages don't get swallowed.

    0 讨论(0)
提交回复
热议问题