[google-appengine] Re: GAE Flex PHP env better logging format

2017-05-26 Thread 'Jun (Cloud Platform Support)' via Google App Engine
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

[google-appengine] Re: GAE Flex PHP env better logging format

2017-05-30 Thread Yao Li
> I think you can just use other PSR compliant logger, rather than using the PsrBatchLogger on your local machine. Could you give me some examples for other PSR compliant logger? > Is this happening on App Engine Flex production server, or locally? It's on App Engine Flex production server

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-26 Thread 'Takashi Matsuo' via Google App Engine
We're developing a new logging library, which is under alpha testing phase ( instructoins ). Please try this and let us know how it works for you. Thanks, On Fri, May 26, 2017 at 9:59 AM '

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-30 Thread Yao Li
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

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-30 Thread Yao Li
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 produc

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-30 Thread Yao Li
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 projec

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-30 Thread 'Takashi Matsuo' via Google App Engine
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

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-30 Thread 'Takashi Matsuo' via Google App Engine
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 w

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-30 Thread 'Takashi Matsuo' via Google App Engine
Hi Yao, On Tue, May 30, 2017 at 9:39 PM Yao Li wrote: > > I think you can just use other PSR compliant logger, rather than using > the PsrBatchLogger on your local machine. > > Could you give me some examples for other PSR compliant logger? > Monolog? ``` composer require monolog/monolog ```

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-31 Thread Yao Li
I tried Monolog and it is super fast (stdout in example), but it has logging line by line and no severity, time and status code info like original gcloud logging under one request, is there any way to achieve that with Monolog? On Tuesday, May 30, 2017 at 11:24:01 PM UTC-7, Takashi Matsuo (Goog

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-31 Thread Yao Li
I tested PsrBatchLogger with the example code in the doc, but it complains: PHP message: [ERROR] PHP Exception: No project ID was provided, and we were unable to detect a default project ID. Stack Trace: #0 /app/vendor/google/cloud-core/ClientTrait.php(81): Google\Cloud\Logging\LoggingClient->de

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-31 Thread Yao Li
I fixed the project id issue for PsrBatchLogger, but it always create 499 error when make api call. On Wednesday, May 31, 2017 at 4:55:09 PM UTC-7, Yao Li wrote: > > I tried Monolog and it is super fast (stdout in example), but it has > logging line by line and no severity, time and status code

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-05-31 Thread 'Takashi Matsuo' via Google App Engine
Hi Yao, Few questions, Is the 499 error happening on App Engine Flex? Can you share the reproducible project (like zip files)? Can you share the logs with me? Hopefully can you invite me to your project as a viewer so that I can check the logs? On Wed, May 31, 2017 at 10:45 PM Yao Li wrote:

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-06-01 Thread Yao Li
Hi Takashi, 1. Yes, it's happening on App Engine Flex. 2. I cannot share the project because of company's rule. 3. Some log example: 08:09:04.000 172.18.0.3 - - [01/Jun/2017:15:09:04 +] "POST /v0/updateDeviceID HTTP/1.1" 200 86 "-" "FS/2...31 (iPhone; iOS 10.3.1; Scale/2.00)" 08:09:04.000[0

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-06-01 Thread Yao Li
1. I stop using PsrBatchLogger in framework level logging and it doesn't have 499 error. 2. The logging sample works for me, thanks. 3. I found the error for PsrBatchLogger in the current project whose runtime is custom (based on gcr.io/google_appengine/debian8, but your logging example runtim

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-06-01 Thread 'Takashi Matsuo' via Google App Engine
Hi Yao, Maybe you can use one of our base image: gcr.io/google-appengine/php71 gcr.io/google-appengine/php70 gcr.io/google-appengine/php56 They have pcntl extension enabled by default. On Thu, Jun 1, 2017 at 11:02 AM Yao Li wrote: > 1. I stop using PsrBatchLogger in framework level logging and

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-06-01 Thread Yao Li
1. I tested gcr.io/google-appengine/php71 and PsrBatchLogger works on production, I will test more to make sure it doesn't influence performance too much. 2. I tested Monolog as well in production and it prints very fast but not under the request call (case 1) because it outputs to stdout/stder

Re: [google-appengine] Re: GAE Flex PHP env better logging format

2017-06-01 Thread 'Takashi Matsuo' via Google App Engine
Hi Yao, On Thu, Jun 1, 2017 at 2:46 PM Yao Li wrote: > 1. I tested gcr.io/google-appengine/php71 and PsrBatchLogger works on > production, I will test more to make sure it doesn't influence performance > too much. > Great to hear :) Please feel free to ask how to configure the logger. > > 2.