In my config.yml I ahve thsi cnfiguration for log rotation of action server logs. But log file not getting created at all. logging: version: 1 disable_existing_loggers: True formatters: file_formatter: format: ‘%(asctime)s - %(name)s - %(levelname)s - %(message)s’ handlers: action_file_handler: class: logging.handlers.TimedRotatingFileHandler filename: actions.log # Log file name when: ‘midnight’ # Rotate daily interval: 1 # Rotate every 1 day backupCount: 7 # Keep 7 days of logs formatter: file_formatter root: level: INFO handlers: [action_file_handler]
How are you starting your assistant? You need to specify the log config file on the command line with the --logging-config-file
option, e.g.:
rasa inspect --logging-config-file logging.yml
For other command-line options, use the --help
option, for example rasa --help
or rasa inspect --help
.
I have shell script for that #!/bin/bash python3 set_rasa_env.py export $(cat .env | xargs) if [ “$ENV” == “development” ] then export MONGODB_URI=“mongodb+srv://${MONGODB_USER}:${MONGODB_PASS}${MONGODB_CLUSTER_LOCAL}” else export MONGODB_URI=“mongodb+srv://${MONGODB_USER}:${MONGODB_PASS}${MONGODB_CLUSTER}” fi rasa run actions --debug --logging-config-file logging.yml
and my logging.yml looks like
version: 1 logging: version: 1 disable_existing_loggers: False formatters: file_formatter: format: ‘%(asctime)s - %(name)s - %(levelname)s - %(message)s’ handlers: action_file_handler: class: logging.handlers.TimedRotatingFileHandler filename: actions.log # Log file name when: ‘midnight’ # Rotate daily interval: 1 # Rotate every 1 day backupCount: 7 # Keep 7 days of logs formatter: file_formatter root: level: INFO handlers: [action_file_handler]
and my action start script gets stuck like this
(venv) geetadesai@MacBook-Pro rasa-calm % ./scripts/startup/start_rasa_action_server.sh .env file loaded successfully 2024-09-19 14:37:03 INFO root - .env file loaded successfully 2024-09-19 14:37:03 INFO root - silver_count: 15 2024-09-19 14:37:03 INFO root - gold_count: 20 2024-09-19 14:37:03 INFO root - platinum_count: 25 2024-09-19 14:37:03 INFO root - .env file loaded successfully
2024-09-19 14:37:03 INFO root - silver_count: 15 2024-09-19 14:37:03 INFO root - gold_count: 20 2024-09-19 14:37:03 INFO root - platinum_count: 25 2024-09-19 14:37:03 INFO root - platinum_count: 10 MONGO DB USER mongoadmin 2024-09-19 14:37:03 INFO flask_project.app - conversation_day_limit: 20 conversation_day_limit: 20
If I remove loggign parameter server starts fine but still log file is not created
I solved it by adding proper loggers for rasa_sdk.executor, rasa_sdk.endpoint etc. sepereatly. Thank you