Is it possible to generate normal logs in custom scripts? #1394
Unanswered
emr-arvig
asked this question in
Getting Help
Replies: 1 comment
-
Hello, I had successed in printing Tenants name during the execution of a script here is how I did it : logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__) then in the run method: def run(self, data, commit):
tenant = data['tenant']
logger.info(f"{tenant.name}") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I cannot generate any regular stdout log messages to the console from the run method or any other method in custom scripts.
We have a number of scripts that get quite complex, and I would like to log them so we are able to see them by tailing the logs of our kubernetes pods. It has caused many hours of troubleshooting and headache.
I have copied a logging config into my docker file. Here it is:
I created a new Test script just to see if I could get logging to work.
With the logging configuration, I can get logs on the module level of the file, or in the global scope, but I cannot get any logging to happen in any of the methods on the script class
Here is my TestScript class:
You can see the logs on the module level, but never when you run the script via the run method:
Is there any way to get this to work?
Beta Was this translation helpful? Give feedback.
All reactions