Write us what you want & improve the DevOpsCloud website for easy to use.

To stop spammers/bots in Telegram, we have added a captcha while joining the Telegram group, which means every new member, has to authenticate within 60 seconds while joining the group.

Home >>All Articles

Published Articles (117)

Sort by:
  • All |
  • AWS (52) | 
  • Azure (31) | 
  • DevOps (9) | 
  • FREE Udemy Courses (6) | 
  • GCP (1) | 
  • Linux (1) | 

AVR posted:
3 years ago
What is logging in Python?

When we use python code in Databricks to develop spark code, we need to use the python logging module to implement logging
What is the use of logging?
Why do we need to collect the logs?
Why do we need logs?
If any failures happen in the process/jobs, then this is where we need logs to fix any issues
What went wrong?
What is the error message?
We can quickly troubleshoot based on the error logs and appropriate action can be taken if necessary
Also,
while we are inserting data into database tables, this information also can be logged into the logging
We can also log the queries which got executed while inserting the data into tables
Logs are also used to improve the functionality
There are lots of advantages if we collect the logs in any process
Logging can be done at all the levels in any application development
Java developer
Python developer
Web Application developer
Data Engineer
Data Scientist
Every application/process should collect the logs as MANDATORY in any enterprise environment


import logging
logging. debug('This is a debug message') - This is Level 1
logging. info('This is an info message') - This is Level 2
logging. warning('This is a warning message') - This is Level 3
logging. error ('This is an error message') - This is Level 4
logging.critical('This is a critical message') - This is Level 5
View replies (0)
Posted in: Python | ID: Q94 |
May 07, 2022, 10:11 AM | 0 Replies