File size: 378 Bytes
7713f64 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import logging
# Configure logging
logging.basicConfig(
level=logging.INFO, # Set the default logging level
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[
logging.StreamHandler(), # Log to the console
logging.FileHandler("app.log", mode="a") # Log to a file
]
)
# Create a logger instance
logger = logging.getLogger(__name__) |