...
Setting the Log Level Permanently To make a permanent change, omit the
-t
parameter:Code Block ./log_level_script.sh -d 192.168.1.100 -p admin:password -i 15
This sets the log level to 15 permanently until you manually change it.
Setting the Log Level Temporarily Specify a duration (in seconds) with the
-t
parameter to revert automatically after a defined period:Code Block ./log_level_script.sh -d 192.168.1.100 -p admin:password -i 15 -t 600
In this example, the log level is set to 15 and reverts to the original level after 600 seconds (5 minutes).
Monitoring Log File Size
The script identifies the log file (
castor.log
) in either/var/log/caringo/
or/var/log/datacore/
.Initial file size is shown before setting the new log level.
Final file size and size difference are displayed after the temporary duration ends, indicating logs generated during this period.
Output Details
The script displays Swarm IP, log file location, initial and final log file sizes, and the cluster name.
For temporary log levels, a countdown timer displays time remaining before reverting.
Once completed, it provides the approximate amount of logs generated, duration, and confirms reversion to the original log level.
Example Output
Code Block |
---|
Using Swarm IP from SCSP_HOST: 192.168.1.100 Credentials: [hidden for security] Cluster Name: Cluster_01 Log file located at: /var/log/datacore/castor.log Initial log file size: 10.5MB Retrieving the current log level... New log level: 15 Current log level is 30. Updating log level to 15... Log level changed successfully from 30 → 15. Keeping log level at 15 for 600 second(s)... Time's up! Reverting log level back to 30... Approximate 1.2MB new logs were generated at log level 15. Current castor.log size is 11.7MB after 00:10:00. Log level reverted successfully back to 30. |
...