App Engine's logging library requires a context object as its first
argument, so I'm not sure which log package you're using right now. The
correct way to use the App Engine logging library is to create a context
somewhere early on in the request's life-cycle and use it as the first
argument to the log functions.

ctx := appengine.NewContext(r)  // Where r is your *http.Request object
log.Infof(ctx, "$$$$$$$$$$$$$$$$$$$$ handleMain() called")

Let me know what behavior you see doing this.

On Fri, Nov 9, 2018 at 1:15 PM Bryan <[email protected]> wrote:

> I replaced the fmt.Print statement  with:
>
> log.Infof("$$$$$$$$$$$$$$$$$$$$ handleMain() called")
>
> The local server still serves the page correctly but the log Info is not
> showing up in the dev_appserver.py logs in Terminal.
>
> On Thursday, November 8, 2018 at 5:57:06 PM UTC-5, Tyler Compton wrote:
>
>> I believe that the most correct way to do logging with App Engine is to
>> use the log package (https://godoc.org/google.golang.org/appengine/log).
>> This, to my understanding, allows App Engine to categorize logs based on
>> which request they are from alongside some other metadata. Do you see
>> printouts using this package?
>>
>> On Thu, Nov 8, 2018 at 1:02 PM Bryan <[email protected]> wrote:
>>
> The local webserver renders the page correctly at http://localhost:8080/
>>>
>>> I"m using the code from
>>> https://github.com/GoogleCloudPlatform/golang-samples/tree/master/appengine/helloworld
>>>
>>> I put a print statement at line 20 of hello.go :
>>>
>>>     fmt.Print("$$$$$$$$$$$$$$$$ hello.handle() called")
>>>
>>> I'm starting the local server with:
>>>
>>>     $ dev_appserver.py app.yaml
>>>
>>> Shouldn't the print statement be showing up in the osX Terminal window
>>> server logs?
>>>
>>> I could have sworn I was not having this issue a few weeks ago. How do I
>>> check that the wrapper is capable of processing STDOUT?
>>>
>>> How do I fix it?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>>
>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [email protected].
>>
>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to