【问题标题】:How to get a more detailed log from nextcloud docker container如何从 nextcloud docker 容器中获取更详细的日志
【发布时间】:2019-07-26 03:07:35
【问题描述】:

我按照https://blog.ssdnodes.com/blog/installing-nextcloud-docker/ 上的指南运行了 docker 容器。 我将 nextcloud-proxy 的端口映射更改为 7443:443、780:80,因为我的服务器已经运行了 apache。

当我打开页面 foo.bar.com:7443 时,它向我显示 nginx 的服务器错误 500 页面。

docker logs --details nextcloud-proxy 只显示错误 500 页面已成功交付。

docker logs --details nextcloud-app 没有显示有关请求的任何错误。它只在启动过程中显示一些消息:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.5. Set the 'ServerName' directive globally to suppress this message
[Mon Mar 04 19:23:01.413561 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.15 configured -- resuming normal operations
[Mon Mar 04 19:23:01.413653 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

很明显,apache 或 php 存在错误(两者都应由 nextcloud-app 记录)。但我需要查看错误日志条目。我该怎么做?

【问题讨论】:

    标签: apache docker logging nextcloud


    【解决方案1】:

    如果您使用此开关运行 nextcloud 以将其挂载到主机上的文件夹,则更好,通过设置 loglevel 编辑 config/config.php 以获得更细粒度的日志,运行 tail -f data/nextcloud.logs

    docker run -v ~/Projects/nextcloud:/var/www/html -d -p 8080:80 nextcloud
    
    <?php
    $CONFIG = array (
        'htaccess.RewriteBase' => '/',
    ...
    ...
    ...
        'loglevel' => 0,
    );
    

    运行docker restart YOUR_INSTNANCE_ID重启docker镜像

    然后docker exec -it YOUR_INSTNANCE_ID bash -c "tail -f /var/www/html/data/nextcloud.log"

    【讨论】:

      【解决方案2】:

      日志被重定向到 nextcloud 的数据文件夹。

      从 nextcloud 的根目录中尝试:

      $ tail nextcloud/data/nextcloud.log
      

      (或您为数据存储设置的文件夹)。

      【讨论】:

      • 在我的系统上是tail -f volumes/html/data/nextcloud.log
      猜你喜欢
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-16
      • 1970-01-01
      • 2015-07-05
      相关资源
      最近更新 更多