You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AEM自定义日志未在Felix控制台Log Support中显示求助

解决AEM自定义日志在Felix Log Support不显示的问题

Got it, let's work through this issue step by step since you can't create new log entries via Felix Log Support due to production permissions, and your existing CRXDE-created log config isn't showing up.

步骤1:检查自定义日志配置文件的命名与内容

First off, make sure your config file in /apps/system/config follows the correct naming convention and has all required properties:

  • 文件名要求: It should be formatted as org.apache.sling.commons.log.LogManager.factory.config-<your-log-id>.config (e.g., org.apache.sling.commons.log.LogManager.factory.config-myapp-custom.log.config). This naming pattern tells OSGi it's a logging configuration.
  • 必要配置属性: Open the config file in CRXDE and verify it includes these key settings (adjust values to match your needs):
    org.apache.sling.commons.log.level=INFO
    org.apache.sling.commons.log.file=logs/myapp-custom.log
    org.apache.sling.commons.log.pattern={0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}
    org.apache.sling.commons.log.names=com.yourcompany.yourproject
    
    • org.apache.sling.commons.log.level: Sets the minimum log level (INFO, DEBUG, ERROR, etc.)
    • org.apache.sling.commons.log.file: Path to your log file (use a relative path from AEM's crx-quickstart folder, like logs/ for standard log location)
    • org.apache.sling.commons.log.names: The Java package(s) whose logs you want to capture (e.g., your project's code packages)

步骤2:确保节点类型为sling:OsgiConfig

OSGi won't recognize your config file unless it's set to the right node type:

  1. In CRXDE, right-click your config file node.
  2. Select Change Node Type.
  3. Choose sling:OsgiConfig from the list and save.

步骤3:触发OSGi配置刷新

Since you can't use Felix console to reload configs, here's how to get the system to pick up your changes:

  • Save and wait: Right-click your config file in CRXDE and select Save All. OSGi typically scans for config changes every few minutes, so give it 5-10 minutes to refresh.
  • Command line refresh (if you have access): If you can run commands on the server, use this curl request to force a config reload (replace placeholders with your AEM details):
    curl -u <admin-username>:<admin-password> -X POST http://<aem-host>:<port>/system/console/configMgr/org.apache.sling.commons.log.LogManager.factory.config-<your-log-id>
    

步骤4:验证日志生成与权限

  • Check if your log file exists in AEM's crx-quickstart/logs folder (or the path you specified). If it's there and has content, the config is working—Felix Log Support just needs to catch up.
  • Ensure your config file has proper permissions in CRXDE: Right-click the node → Permissions → Make sure everyone has Read access. OSGi can't load configs it can't read.

步骤5:Troubleshooting if it still doesn't show up

If the log file exists but Felix Log Support still doesn't list it:

  • Double-check the org.apache.sling.commons.log.file path—avoid absolute paths, stick to relative paths under crx-quickstart.
  • If you're using a custom log path outside logs/, verify the server user has write permissions to that directory. Production servers often restrict write access to non-standard locations.

Give these steps a shot, and your custom log should appear in Felix Log Support once the OSGi config is fully loaded.


内容的提问来源于stack exchange,提问作者Arunmozhi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 07:43:19