Hello,
Once you change Openlitespeed vhost config to use a different errorlog and accesslog location,
the Log Tab on the Panel does not show logs. The code is fixed to get the logs from the default location only, it does not get the location based on the errorlog and accesslog variables in the(/www/server/panel/vhost/openlitespeed/detail)
conf file for each vhost.
i found a work around by modifying the Panel panel_site_v2.py
file to fetch the logs from my custom location using the following:
update_aapanel_log_paths() {
log "Updating aaPanel log paths..."
local V1="/www/server/panel/class/panelSite.py"
local V2="/www/server/panel/class_v2/panel_site_v2.py"
local files_to_patch=()
# Check which files exist
[ -f "$V1" ] && files_to_patch+=("$V1")
[ -f "$V2" ] && files_to_patch+=("$V2")
if [ ${#files_to_patch[@]} -eq 0 ]; then
log "No aaPanel site management files found to patch. Skipping."
return
fi
for file in "${files_to_patch[@]}"; do
# Create a one-time backup
if [ ! -f "${file}.vhost_tunning_bak" ]; then
log "Creating backup for ${file}..."
cp "$file" "${file}.vhost_tunning_bak"
fi
# Check if patching is needed before applying sed
if grep -q "'/www/wwwlogs/'[[:space:]]*+[[:space:]]*get.siteName[[:space:]]*+[[:space:]]*'_ols\." "$file"; then
log "Patching OLS log paths in ${file}..."
# Update OLS access log path
sed -i "s|'/www/wwwlogs/'[[:space:]]*+[[:space:]]*get.siteName[[:space:]]*+[[:space:]]*'_ols\.access_log'|'/www/wwwlogs/' + get.siteName + '/ols-access.log'|g" "$file"
# Update OLS error log path
sed -i "s|'/www/wwwlogs/'[[:space:]]*+[[:space:]]*get.siteName[[:space:]]*+[[:space:]]*'_ols\.error_log'|'/www/wwwlogs/' + get.siteName + '/ols-error.log'|g" "$file"
log "Finished patching ${file}."
else
log "Log paths in ${file} appear to be already updated. Skipping patch."
fi
done
}
This works but its not sustainable. Every-time the panel is fixed or there is an update, aapanel downloads a new panel_site_v2.py
. overwriting my custom changes
Can we please have a fix for this on the next update. Because the default logs location are not really user friendly, especially if you have multiple sites, they all just put on the same folder and it becomes a mess.
Thank you.