feat: comprehensive INFO/WARN/ERROR logging across all controller modules
Add structured operational logging at INFO, WARN, and ERROR levels to every controller module. Standardize custom prefixes ([GEO], [SCHED], [SYNC]) to use [INFO/WARN/ERROR] [module] format. Fix misleveled logs (WARN->ERROR for data loss scenarios, WARN->INFO for routine operations). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ type OnlyOfficeFileBrowserHandler struct{}
|
||||
func (h *OnlyOfficeFileBrowserHandler) Apply(ac *ApplyContext) error {
|
||||
jwtSecret := ac.ProviderEnv["JWT_SECRET"]
|
||||
if jwtSecret == "" {
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser apply: JWT_SECRET not set")
|
||||
return fmt.Errorf("OnlyOffice JWT_SECRET nincs beállítva — telepítsd újra az alkalmazást")
|
||||
}
|
||||
|
||||
@@ -21,6 +22,7 @@ func (h *OnlyOfficeFileBrowserHandler) Apply(ac *ApplyContext) error {
|
||||
subdomain = ac.ProviderMeta.Subdomain
|
||||
}
|
||||
if subdomain == "" {
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser apply: subdomain unknown")
|
||||
return fmt.Errorf("OnlyOffice aldomain nem ismert")
|
||||
}
|
||||
|
||||
@@ -31,6 +33,7 @@ func (h *OnlyOfficeFileBrowserHandler) Apply(ac *ApplyContext) error {
|
||||
|
||||
configData, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser apply: %v", err)
|
||||
return fmt.Errorf("FileBrowser config olvasási hiba: %w", err)
|
||||
}
|
||||
|
||||
@@ -47,10 +50,12 @@ func (h *OnlyOfficeFileBrowserHandler) Apply(ac *ApplyContext) error {
|
||||
// Atomic write
|
||||
tmpPath := configPath + ".tmp"
|
||||
if err := os.WriteFile(tmpPath, []byte(configStr), 0644); err != nil {
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser apply: %v", err)
|
||||
return fmt.Errorf("config írási hiba: %w", err)
|
||||
}
|
||||
if err := os.Rename(tmpPath, configPath); err != nil {
|
||||
_ = os.Remove(tmpPath)
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser apply: %v", err)
|
||||
return fmt.Errorf("config átnevezési hiba: %w", err)
|
||||
}
|
||||
|
||||
@@ -67,6 +72,7 @@ func (h *OnlyOfficeFileBrowserHandler) Revoke(ac *ApplyContext) error {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser revoke: %v", err)
|
||||
return fmt.Errorf("config olvasási hiba: %w", err)
|
||||
}
|
||||
|
||||
@@ -79,10 +85,12 @@ func (h *OnlyOfficeFileBrowserHandler) Revoke(ac *ApplyContext) error {
|
||||
|
||||
tmpPath := configPath + ".tmp"
|
||||
if err := os.WriteFile(tmpPath, []byte(cleaned), 0644); err != nil {
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser revoke: %v", err)
|
||||
return fmt.Errorf("config írási hiba: %w", err)
|
||||
}
|
||||
if err := os.Rename(tmpPath, configPath); err != nil {
|
||||
_ = os.Remove(tmpPath)
|
||||
ac.Logger.Printf("[ERROR] [integrations] OnlyOffice-FileBrowser revoke: %v", err)
|
||||
return fmt.Errorf("config átnevezési hiba: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user