Thanks for the discussion! 

This PR is only about suppressing results in action logs. If a user still 
wants to have the result in the action log then he or she can simply add a 
log statement in the action for that. Why should we introduce a new 
mechanism for this like an annotation for automatically adding the result 
to the log (or not)? Seems complicated. 

In our specific case we need the flag per invocation because we want to 
the add the result in error cases. For example: main is not defined, 
compile error in action, etc. see below:

1) no main() in js 
        "result": {
            "error": "Initialization has failed due to: ReferenceError: 
main is not defined\n
                at eval (eval at <anonymous> 
(/nodejsAction/runner.js:79:109), <anonymous>:8:8)\n
                at eval (eval at <anonymous> 
(/nodejsAction/runner.js:79:109), <anonymous>:8:14)\n
                at NodeActionRunner.init (/nodejsAction/runner.js:79:45)\n
                at doInit (/nodejsAction/src/service.js:142:31)\n
                at initCode (/nodejsAction/src/service.js:81:24)\n
                at /nodejsAction/app.js:69:13\n
                at Layer.handle [as handle_request] 
(/node_modules/express/lib/router/layer.js:95:5)\n
                at next 
(/node_modules/express/lib/router/route.js:131:13)\n
                at Route.dispatch 
(/node_modules/express/lib/router/route.js:112:3)\n
                at Layer.handle [as handle_request] 
(/node_modules/express/lib/router/layer.js:95:5)"
 
2) compile Error
        "result": {
            "error": "Initialization has failed due to: SyntaxError: 
Unexpected identifier\n
                at NodeActionRunner.init 
(/nodejsAction/runner.js:79:109)\n
                at doInit (/nodejsAction/src/service.js:142:31)\n
                at initCode (/nodejsAction/src/service.js:81:24)\n
                at /nodejsAction/app.js:69:13\n
                at Layer.handle [as handle_request] 
(/node_modules/express/lib/router/layer.js:95:5)\n
                at next 
(/node_modules/express/lib/router/route.js:131:13)\n
                at Route.dispatch 
(/node_modules/express/lib/router/route.js:112:3)\n
                at Layer.handle [as handle_request] 
(/node_modules/express/lib/router/layer.js:95:5)\n
                at /node_modules/express/lib/router/index.js:277:22\n
                at Function.process_params 
(/node_modules/express/lib/router/index.js:330:12)"


This kind of information cannot be logged anywhere else and does not 
contain sensible information. It is very helpful information for the 
customer to correct the action. So we do not want to suppress this 
information.



From:   James Thomas <jthomas...@gmail.com>
To:     dev@openwhisk.apache.org
Date:   03/09/2019 15:24
Subject:        [EXTERNAL] Re: Allow decision about action result 
inclusion in logs on a per call basis



This is a sensible change and I agree with what Rodric has suggested:
can we make this a per-action annotation?

On Tue, 3 Sep 2019 at 13:28, Rodric Rabbah <rod...@gmail.com> wrote:
>
> > Action results may contain sensible data that should not be logged.
>
> I interpret this to mean: not stored in the activation record.
>
> If this is what you mean, why not make this a feature controlled per 
action
> using an annotation and let the user decide: ok to save the result, not 
ok
> to save the result, only save the result on error.
>
> -r
>
> On Tue, Sep 3, 2019 at 8:17 AM Ruediger Maass 
<ruediger.ma...@de.ibm.com>
> wrote:
>
> > Action results may contain sensible data that should not be logged. 
There
> > is a system configuration flag (writeResultToFile) that can be used to
> > switch on or off the result inclusion in logs. But this is a global 
switch
> > that holds for all activations. In our case we want to able to decide 
per
> > activation whether or not the result should be included in the log or 
not.
> > In our special case we want results to be included in case of errors 
(in
> > other words, our predicate function for the decision is: 'Does the 
result
> > contain an error field?'). But also other decision logic may be
> > applicable.
> >
> > This PR 
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_openwhisk_pull_4604&d=DwIBaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=X0kuppcoBkurjGK5dhY1vViAOVizrmBkK-unFKRbRys&m=Omwt2ZmfdyerpXiU-HbIwPEvr7znKYAA4DFFhJiyk28&s=3z4nZkA573qZvgihbr448hMHPhnIC4zy7Y8MeuAENU0&e=
 
 is a small change
> > that extends ActivationFileStorage.
> >
> > Please help and comment on the PR.
> >
> > Thank you, Ruediger
> >
> >



-- 
Regards,
James Thomas





Reply via email to