Missing logger name on Google Appengine

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Missing logger name on Google Appengine

Daniel Felix Ferber
Hi,

I have been wondering why the logger name is missing for application log messages on Google Appengine. Instead of the logger name, it displays the sourceClassName and sourceMethodName. (Appengine uses its own logging framework whose API is identical to JUL).

After extensive research I found [1,2,3] and I infer that Appengine converts JUL LogRecords to AppLogLines, which are stored as LogLine JSON representation. Note that AppLogLine and LogLine have no 'logger name' attribute. I conclude that Appengine lacks the 'logger name' concept on its Cloud Platform Log storage.

First, I believe (imho) that logger name is much more significant than class and method name.
Second, as you cannot see the logger name, it gets challenging to configure proper log levels to potentially unknown logger names. This issue mitigated if there is always one logger per class, named exactly as the class FQCN.

I think that SLF4J could aid under Appengine. For example, when adapting log message from SLF4J to JUL, instead of calling fillCallerData(fqcn, logRecord), it could set sourceMethodName to null and sourceClassName to the logger name... Maybe as a wrapper implementation for Appengine?

_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing logger name on Google Appengine

Ceki Gulcu
Hi Daniel,

Do you intend to write this wrapper for Appengine. If so, I would happy
be to reference it from the SLF4J web-site.

--
Ceki


On 3/9/2016 4:54, Daniel Felix Ferber wrote:

> Hi,
>
> I have been wondering why the logger name is missing for application log
> messages on Google Appengine. Instead of the logger name, it displays
> the sourceClassName and sourceMethodName. (Appengine uses its own
> logging framework whose API is identical to JUL).
>
> After extensive research I found [1,2,3] and I infer that Appengine
> converts JUL LogRecords to AppLogLines, which are stored as LogLine JSON
> representation. Note that AppLogLine and LogLine have no 'logger name'
> attribute. I conclude that Appengine lacks the 'logger name' concept on
> its Cloud Platform Log storage.
>
> First, I believe (imho) that logger name is much more significant than
> class and method name.
> Second, as you cannot see the logger name, it gets challenging to
> configure proper log levels to potentially unknown logger names. This
> issue mitigated if there is always one logger per class, named exactly
> as the class FQCN.
>
> I think that SLF4J could aid under Appengine. For example, when adapting
> log message from SLF4J to JUL, instead of calling fillCallerData(fqcn,
> logRecord), it could set sourceMethodName to null and sourceClassName to
> the logger name... Maybe as a wrapper implementation for Appengine?
>
> [1] https://cloud.google.com/appengine/docs/java/logs/
> [2]
> https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/log/AppLogLine
> [3] https://cloud.google.com/logging/docs/api/ref/rest/v1beta3/LogLine
_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing logger name on Google Appengine

Daniel Felix Ferber
Hi Ceki,

I considered the possibility of writing a wrapper on my own. But first I would appreciate your advice if that would actually be a reasonable approach.
Maybe I am missing something and trying to solve it on the wrong way?

One possibility would be a wrapper that is very similar to your JDK14LoggerAdapter, reusing Appengine's JUL implementation. Another possibility would be a wrapper that calls Appengine API directly, but I am not sure if this is possible. I will do some research and prototyping and let you know if succeeded or not.

Best regards,
Daniel

2016-03-09 4:37 GMT-03:00 Ceki Gulcu <[hidden email]>:
Hi Daniel,

Do you intend to write this wrapper for Appengine. If so, I would happy be to reference it from the SLF4J web-site.

--
Ceki



On 3/9/2016 4:54, Daniel Felix Ferber wrote:
Hi,

I have been wondering why the logger name is missing for application log
messages on Google Appengine. Instead of the logger name, it displays
the sourceClassName and sourceMethodName. (Appengine uses its own
logging framework whose API is identical to JUL).

After extensive research I found [1,2,3] and I infer that Appengine
converts JUL LogRecords to AppLogLines, which are stored as LogLine JSON
representation. Note that AppLogLine and LogLine have no 'logger name'
attribute. I conclude that Appengine lacks the 'logger name' concept on
its Cloud Platform Log storage.

First, I believe (imho) that logger name is much more significant than
class and method name.
Second, as you cannot see the logger name, it gets challenging to
configure proper log levels to potentially unknown logger names. This
issue mitigated if there is always one logger per class, named exactly
as the class FQCN.

I think that SLF4J could aid under Appengine. For example, when adapting
log message from SLF4J to JUL, instead of calling fillCallerData(fqcn,
logRecord), it could set sourceMethodName to null and sourceClassName to
the logger name... Maybe as a wrapper implementation for Appengine?

[1] https://cloud.google.com/appengine/docs/java/logs/
[2]
https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/log/AppLogLine
[3] https://cloud.google.com/logging/docs/api/ref/rest/v1beta3/LogLine
_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user


_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing logger name on Google Appengine

Ceki Gulcu


I think JDK14LoggerAdapter is the place to start. As I am not familiar
with Appengine logging I am afraid I can't help much.

On 3/9/2016 14:18, Daniel Felix Ferber wrote:

> Hi Ceki,
>
> I considered the possibility of writing a wrapper on my own. But first I
> would appreciate your advice if that would actually be a reasonable
> approach.
> Maybe I am missing something and trying to solve it on the wrong way?
>
> One possibility would be a wrapper that is very similar to your
> JDK14LoggerAdapter, reusing Appengine's JUL implementation. Another
> possibility would be a wrapper that calls Appengine API directly, but I
> am not sure if this is possible. I will do some research and prototyping
> and let you know if succeeded or not.
>
> Best regards,
> Daniel
>
> 2016-03-09 4:37 GMT-03:00 Ceki Gulcu <[hidden email] <mailto:[hidden email]>>:
>
>     Hi Daniel,
>
>     Do you intend to write this wrapper for Appengine. If so, I would
>     happy be to reference it from the SLF4J web-site.
>
>     --
>     Ceki
>
>
>
>     On 3/9/2016 4:54, Daniel Felix Ferber wrote:
>
>         Hi,
>
>         I have been wondering why the logger name is missing for
>         application log
>         messages on Google Appengine. Instead of the logger name, it
>         displays
>         the sourceClassName and sourceMethodName. (Appengine uses its own
>         logging framework whose API is identical to JUL).
>
>         After extensive research I found [1,2,3] and I infer that Appengine
>         converts JUL LogRecords to AppLogLines, which are stored as
>         LogLine JSON
>         representation. Note that AppLogLine and LogLine have no 'logger
>         name'
>         attribute. I conclude that Appengine lacks the 'logger name'
>         concept on
>         its Cloud Platform Log storage.
>
>         First, I believe (imho) that logger name is much more
>         significant than
>         class and method name.
>         Second, as you cannot see the logger name, it gets challenging to
>         configure proper log levels to potentially unknown logger names.
>         This
>         issue mitigated if there is always one logger per class, named
>         exactly
>         as the class FQCN.
>
>         I think that SLF4J could aid under Appengine. For example, when
>         adapting
>         log message from SLF4J to JUL, instead of calling
>         fillCallerData(fqcn,
>         logRecord), it could set sourceMethodName to null and
>         sourceClassName to
>         the logger name... Maybe as a wrapper implementation for Appengine?
>
>         [1] https://cloud.google.com/appengine/docs/java/logs/
>         [2]
>         https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/log/AppLogLine
>         [3]
>         https://cloud.google.com/logging/docs/api/ref/rest/v1beta3/LogLine
>
>     _______________________________________________
>     slf4j-user mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://mailman.qos.ch/mailman/listinfo/slf4j-user
>
>
>
>
> _______________________________________________
> slf4j-user mailing list
> [hidden email]
> http://mailman.qos.ch/mailman/listinfo/slf4j-user
>
_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Missing logger name on Google Appengine

Daniel Felix Ferber
Hi Ceki,

Just to let you know about my progress on investigating if it is possible to adapt SLF4J better for Google Appengine.
It worked well for local deploy on Appengine SDK, but did not have any effect on Appengines production environment.
I did not give up yet, but I have been short on time. I will write eventually about further results.

Best regards,
Daniel Felix Ferber

2016-03-09 11:52 GMT-03:00 Ceki Gulcu <[hidden email]>:


I think JDK14LoggerAdapter is the place to start. As I am not familiar with Appengine logging I am afraid I can't help much.

On 3/9/2016 14:18, Daniel Felix Ferber wrote:
Hi Ceki,

I considered the possibility of writing a wrapper on my own. But first I
would appreciate your advice if that would actually be a reasonable
approach.
Maybe I am missing something and trying to solve it on the wrong way?

One possibility would be a wrapper that is very similar to your
JDK14LoggerAdapter, reusing Appengine's JUL implementation. Another
possibility would be a wrapper that calls Appengine API directly, but I
am not sure if this is possible. I will do some research and prototyping
and let you know if succeeded or not.

Best regards,
Daniel

2016-03-09 4:37 GMT-03:00 Ceki Gulcu <[hidden email] <mailto:[hidden email]>>:


    Hi Daniel,

    Do you intend to write this wrapper for Appengine. If so, I would
    happy be to reference it from the SLF4J web-site.

    --
    Ceki



    On 3/9/2016 4:54, Daniel Felix Ferber wrote:

        Hi,

        I have been wondering why the logger name is missing for
        application log
        messages on Google Appengine. Instead of the logger name, it
        displays
        the sourceClassName and sourceMethodName. (Appengine uses its own
        logging framework whose API is identical to JUL).

        After extensive research I found [1,2,3] and I infer that Appengine
        converts JUL LogRecords to AppLogLines, which are stored as
        LogLine JSON
        representation. Note that AppLogLine and LogLine have no 'logger
        name'
        attribute. I conclude that Appengine lacks the 'logger name'
        concept on
        its Cloud Platform Log storage.

        First, I believe (imho) that logger name is much more
        significant than
        class and method name.
        Second, as you cannot see the logger name, it gets challenging to
        configure proper log levels to potentially unknown logger names.
        This
        issue mitigated if there is always one logger per class, named
        exactly
        as the class FQCN.

        I think that SLF4J could aid under Appengine. For example, when
        adapting
        log message from SLF4J to JUL, instead of calling
        fillCallerData(fqcn,
        logRecord), it could set sourceMethodName to null and
        sourceClassName to
        the logger name... Maybe as a wrapper implementation for Appengine?

        [1] https://cloud.google.com/appengine/docs/java/logs/
        [2]
        https://cloud.google.com/appengine/docs/java/javadoc/com/google/appengine/api/log/AppLogLine
        [3]
        https://cloud.google.com/logging/docs/api/ref/rest/v1beta3/LogLine

    _______________________________________________
    slf4j-user mailing list
    [hidden email] <mailto:[hidden email]>
    http://mailman.qos.ch/mailman/listinfo/slf4j-user




_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user

_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user


_______________________________________________
slf4j-user mailing list
[hidden email]
http://mailman.qos.ch/mailman/listinfo/slf4j-user
Loading...