Technology Encyclopedia Home >How to view Cloudbase-Init execution log?

How to view Cloudbase-Init execution log?

To view the Cloudbase-Init execution log, you can check the log files generated by Cloudbase-Init during its initialization process. The logs provide detailed information about the steps executed, errors encountered, and other relevant events.

Steps to View Cloudbase-Init Logs:

  1. Default Log Location:

    • On Windows instances, the logs are typically stored in:
      C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\cloudbase-init.log
      
    • On Linux instances, the logs are usually found in:
      /var/log/cloudbase-init.log
      
  2. Check Log Content:

    • Open the log file using a text editor (e.g., notepad on Windows or cat/less on Linux).
    • Look for entries related to the initialization process, such as metadata service calls, user data execution, or network configuration.
  3. Enable Debug Logging (Optional):

    • If the default logs lack sufficient detail, you can enable debug-level logging by modifying the Cloudbase-Init configuration file (cloudbase-init.conf).
    • Set the debug parameter to True and restart the Cloudbase-Init service.

Example:

On a Windows instance, you might see entries like:

2024-01-01 12:00:00,000 - cloudbaseinit - INFO - Executing plugin: SetUserSSHPublicKeys  
2024-01-01 12:00:01,000 - cloudbaseinit - ERROR - Failed to set SSH keys: Permission denied  

On a Linux instance, the log might show:

2024-01-01 12:00:00,000 - cloudbaseinit - INFO - Running plugin: set_hostname  
2024-01-01 12:00:01,000 - cloudbaseinit - WARNING - Metadata service timeout  

Tencent Cloud Recommendation:

If you're using Tencent Cloud, you can also check instance system logs in the Tencent Cloud Console under Cloud Virtual Machine (CVM) > Instance Details > Log > System Log. For more advanced logging and monitoring, consider using Tencent Cloud Cloud Log Service (CLS) to centralize and analyze Cloudbase-Init logs.