Hi Yao,

> make the format pretty

The new logging library will automatically add some useful metadata
(monitored resources, trace id, severity). They look very nice to me on the
logging UI, but what do you mean exactly by making the format pretty?

On Tue, May 30, 2017 at 5:29 PM Takashi Matsuo <[email protected]> wrote:

>
> Hi Yao,
>
> > Does it make API request (Google Logging, will be slow in production) or
> just print to stdout/stderr (should be super fast in production)?
> It's making API requests, but in background in batch if you're using the
> daemon, so it should be fast.
>
> > If it has to make API request, is there any way to write locally and
> also make the format pretty?
>
> I think you can just use other PSR compliant logger, rather than using the
> PsrBatchLogger on your local machine.
>
> > But it complains about...
>
> Is this happening on App Engine Flex production server, or locally? I'm
> asking because it should just work on App Engine Flex.
> Can you give me a reproducible sample?
>
>
> On Tue, May 30, 2017 at 3:15 PM Yao Li <[email protected]> wrote:
>
>> I used the code in example with logName as 'app',
>>
>> $batchLogger = new PsrBatchLogger('app'); // logName `app`
>>
>> But it complains about
>>
>> "NOTICE: PHP message: Failed to send log to Google: {"
>>
>> " "error": {"
>>
>> " "code": 400,"
>>
>> " "message": "Name is missing the logs component. Expected the form
>> projects/[PROJECT_ID]/logs/[ID]","
>>
>> " "status": "INVALID_ARGUMENT""
>>
>> " }"
>>
>> "}"
>>
>>
>> do I need change 'app' to 'projects/my_project_id/logs/[ID]', how can I
>> get ID or I define it by myself, like user unix timestamp?
>>
>> On Tuesday, May 30, 2017 at 2:20:59 PM UTC-7, Yao Li wrote:
>>>
>>> If it has to make API request, is there any way to write locally and
>>> also make the format pretty?
>>>
>>> On Tuesday, May 30, 2017 at 2:13:48 PM UTC-7, Yao Li wrote:
>>>>
>>>> Does it make API request (Google Logging, will be slow in production)
>>>> or just print to stdout/stderr (should be super fast in production)?
>>>>
>>>> On Friday, May 26, 2017 at 7:53:01 PM UTC-7, Takashi Matsuo (Google)
>>>> wrote:
>>>>>
>>>>>
>>>>> We're developing a new logging library, which is under alpha testing
>>>>> phase (instructoins
>>>>> <https://docs.google.com/document/d/126NJTDNctB0zL8dwTo8-9indyWGUXpGkrXCKrHU4b-s/edit#heading=h.8t69iwn5s7dr>).
>>>>> Please try this and let us know how it works for you.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> On Fri, May 26, 2017 at 9:59 AM 'Jun (Cloud Platform Support)' via
>>>>> Google App Engine <[email protected]> wrote:
>>>>>
>>>>>> Hi Yao,
>>>>>>
>>>>>> You can actually write your application log entries using the
>>>>>> psrLogger method, which will fetch a PSR-3 complaint logger, and you can
>>>>>> have more info by looking at Writing applications logs
>>>>>> <https://cloud.google.com/appengine/docs/flexible/php/writing-application-logs#writing_application_logs_1>
>>>>>> .
>>>>>>
>>>>>> - Jun
>>>>>>
>>>>>>
>>>>>> On Thursday, May 25, 2017 at 6:36:25 PM UTC-4, Yao Li wrote:
>>>>>>>
>>>>>>> I have an app is built on GAE Flex Custom env (GCloud PHP Ngnix docker 
>>>>>>> image based), I want to improve the application logging format.
>>>>>>>
>>>>>>>
>>>>>>> How can I make the application log format better (more readable, with 
>>>>>>> timestamp, POST/GET method name, status code (200), size (22 B), time 
>>>>>>> (4ms), browser(chrome) in one line, put stack trace together instead of 
>>>>>>> multiple lines now) like GAE logging format?
>>>>>>>
>>>>>>>
>>>>>>> All of the following logs are from Google Cloud Platform Console, 
>>>>>>> Logging page/tab.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> (GAE default logging:)
>>>>>>>
>>>>>>>
>>>>>>> 15:21:23.667POST20022 B4 msChrome 56/User/isHuman
>>>>>>>
>>>>>>>
>>>>>>>  (my application log, I want to collect following lines into one part 
>>>>>>> like above default one rather than multi lines:)
>>>>>>>
>>>>>>>
>>>>>>> 15:21:27.0002017/05/25 22:21:27 [error] 23#23: *34128 FastCGI sent in 
>>>>>>> stderr: "PHP message: [WARN] jsVersion does not match:3617 3623
>>>>>>>
>>>>>>> 15:21:27.000 Stack Trace:
>>>>>>>
>>>>>>> 15:21:27.000Array
>>>>>>>
>>>>>>> 15:21:27.000(
>>>>>>>
>>>>>>> 15:21:27.000[0] => Array
>>>>>>>
>>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Google App Engine" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To post to this group, send email to [email protected].
>>>>>> Visit this group at https://groups.google.com/group/google-appengine.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/google-appengine/d8d50887-c512-451a-ac13-d91ecda235b6%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/google-appengine/d8d50887-c512-451a-ac13-d91ecda235b6%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> --
>>>>> -- Takashi
>>>>>
>>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/google-appengine.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-appengine/c935b2ca-feee-47e6-9b11-7083418f1f3a%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-appengine/c935b2ca-feee-47e6-9b11-7083418f1f3a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> -- Takashi
>
-- 
-- Takashi

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CADWEYXidU7hba-m76NZCNgyxTyxOJqoNNV5Z3WyZuYgeMvq9QA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to