mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fix log to stdout
This commit is contained in:
@@ -65,6 +65,8 @@ RUN echo "error_log = /dev/stderr" >> /usr/local/etc/php/conf.d/error-logging.in
|
|||||||
# 安装 Composer
|
# 安装 Composer
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
ENV LOG_CHANNEL=stderr
|
||||||
|
|
||||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ if [ "$SERVICE_NAME" = "php" ]; then
|
|||||||
if [ ! -f "$ENV_FILE" ]; then
|
if [ ! -f "$ENV_FILE" ]; then
|
||||||
echo_info ".env file: $ENV_FILE not exists, copy $SOURCE_DIR to $TARGET_DIR ..."
|
echo_info ".env file: $ENV_FILE not exists, copy $SOURCE_DIR to $TARGET_DIR ..."
|
||||||
cp -r "$SOURCE_DIR" "$TARGET_DIR"
|
cp -r "$SOURCE_DIR" "$TARGET_DIR"
|
||||||
sed -i 's|LOG_FILE.*|LOG_FILE=/dev/stdout|g' "$ROOT_PATH/.env.example"
|
sed -i 's|LOG_FILE.*|LOG_FILE=php://stdout|g' "$ROOT_PATH/.env.example"
|
||||||
else
|
else
|
||||||
echo_success ".env file: $ENV_FILE already exists, skip copy install file ..."
|
echo_success ".env file: $ENV_FILE already exists, skip copy install file ..."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ function getLogFile($append = '')
|
|||||||
return $logFiles[$append];
|
return $logFiles[$append];
|
||||||
}
|
}
|
||||||
$config = nexus_config('nexus');
|
$config = nexus_config('nexus');
|
||||||
if (!empty($config['log_file']) && in_array($config['log_file'], ["/dev/stdout", "/dev/stderr"])) {
|
if (!empty($config['log_file']) && in_array($config['log_file'], ["php://stdout", "php://stderr"])) {
|
||||||
return $logFiles[$append] = $config['log_file'];
|
return $logFiles[$append] = $config['log_file'];
|
||||||
}
|
}
|
||||||
$path = getenv('NEXUS_LOG_DIR', true);
|
$path = getenv('NEXUS_LOG_DIR', true);
|
||||||
|
|||||||
Reference in New Issue
Block a user