#Logging Best Practices

1 messages · Page 1 of 1 (latest)

normal gyro
#

Hi. I'm working on my first Actor, to understand capabilities of the platform before I build some real Actors. Can someone explain some recommendations around logging? I have my docker container that writes to console. I can see that in Apify so all good. But, for example, if a customer runs my Actor, will they always see exactly the same output I see? I would expect public runs to not include sensitive data, but I would like to see that when I run myself. E.g an exception thrown or error returned by a library I use. I do not want sensitive error details, code/files/line numbers or internal details in the customer's logs, but I would expect them in mine. Can I enforce different log levels for customers vs myself? Maybe this all comes down to: can I configure different environment variables for customers vs myself that can't be overridden by the customer?

#

I can see the 'APIFY_USER_ID' env variable. That would let me distinguish me vs not-me, but seems like a bit of a hack