Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions dspace/config/log4j2-cli.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<Appenders>
<!-- A1 is for most DSpace activity -->
<Appender name='A1'
filePattern="${log.dir}/dspace-cli.log-%d{yyyy-MM-dd}"
filePattern="${log.dir}/dspace-cli.log-%d{yyyy-MM-dd}.gz"
type='RollingFile'
fileName='${log.dir}/dspace-cli.log'
>
Expand All @@ -34,34 +34,18 @@
<policies>
<policy type='TimeBasedTriggeringPolicy'>yyyy-MM-dd</policy>
</policies>
<!-- Sample deletion policy: keep last 30 archived files
<DefaultRolloverStrategy>
<Delete basePath='${log.dir}'>
<IfFileName glob='dspace-cli.log-*'/>
<IfAccumulatedFileCount exceeds='30'/>
</Delete>
</DefaultRolloverStrategy>
-->
</Appender>

<!-- A2 is for the checksum checker -->
<Appender name='A2'
filePattern="${log.dir}/checker.log-%d{yyyy-MM-dd}"
filePattern="${log.dir}/checker.log-%d{yyyy-MM-dd}.gz"
type='RollingFile'
fileName='${log.dir}/checker.log'>
<Layout type='PatternLayout'
pattern='%m%n'/>
<policies>
<policy type='TimeBasedTriggeringPolicy'>yyyy-MM-dd</policy>
</policies>
<!-- Sample deletion policy: keep last 30 archived files
<DefaultRolloverStrategy>
<Delete basePath='${log.dir}'>
<IfFileName glob='checker.log-*'/>
<IfAccumulatedFileCount exceeds='30'/>
</Delete>
</DefaultRolloverStrategy>
-->
</Appender>
</Appenders>

Expand Down
10 changes: 1 addition & 9 deletions dspace/config/log4j2-handle-plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Appenders>
<!-- A1 is for Handle Plugin activity -->
<Appender name='A1'
filePattern="${log.dir}/handle-plugin.log-%d{yyyy-MM-dd}"
filePattern="${log.dir}/handle-plugin.log-%d{yyyy-MM-dd}.gz"
type='RollingFile'
fileName='${log.dir}/handle-plugin.log'

Expand All @@ -25,14 +25,6 @@
<policies>
<policy type='TimeBasedTriggeringPolicy'>yyyy-MM-dd</policy>
</policies>
<!-- Sample deletion policy: keep last 30 archived files
<DefaultRolloverStrategy>
<Delete basePath='${log.dir}'>
<IfFileName glob='dspace.log-*'/>
<IfAccumulatedFileCount exceeds='30'/>
</Delete>
</DefaultRolloverStrategy>
-->
</Appender>

</Appenders>
Expand Down
24 changes: 4 additions & 20 deletions dspace/config/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<Appenders>
<!-- A1 is for most DSpace activity -->
<Appender name='A1'
filePattern="${log.dir}/dspace.log-%d{yyyy-MM-dd}"
filePattern="${log.dir}/dspace.log-%d{yyyy-MM-dd}.gz"
type='RollingFile'
fileName='${log.dir}/dspace.log'

Expand All @@ -37,39 +37,23 @@
<policies>
<policy type='TimeBasedTriggeringPolicy'>yyyy-MM-dd</policy>
</policies>
<!-- Sample deletion policy: keep last 30 archived files
<DefaultRolloverStrategy>
<Delete basePath='${log.dir}'>
<IfFileName glob='dspace.log-*'/>
<IfAccumulatedFileCount exceeds='30'/>
</Delete>
</DefaultRolloverStrategy>
-->
</Appender>

<!-- A2 is for the checksum checker -->
<Appender name='A2'
filePattern="${log.dir}/checker.log-%d{yyyy-MM-dd}"
filePattern="${log.dir}/checker.log-%d{yyyy-MM-dd}.gz"
type='RollingFile'
fileName='${log.dir}/checker.log'>
<Layout type='PatternLayout'
pattern='%m%n'/>
<policies>
<policy type='TimeBasedTriggeringPolicy'>yyyy-MM-dd</policy>
</policies>
<!-- Sample deletion policy: keep last 30 archived files
<DefaultRolloverStrategy>
<Delete basePath='${log.dir}'>
<IfFileName glob='checker.log-*'/>
<IfAccumulatedFileCount exceeds='30'/>
</Delete>
</DefaultRolloverStrategy>
-->
</Appender>

<!-- A3 is for tracking file downloads -->
<Appender name='A3'
filePattern="${log.dir}/file_downloads.log-%d{yyyy-MM-dd}"
filePattern="${log.dir}/file_downloads.log-%d{yyyy-MM-dd}.gz"
type='RollingFile'
fileName='${log.dir}/file_downloads.log'>
<Layout type='PatternLayout'
Expand All @@ -81,7 +65,7 @@

<!-- A4 is for Warns and errors -->
<Appender name='A4'
filePattern="${log.dir}/warn.log-%d{yyyy-MM-dd}"
filePattern="${log.dir}/warn.log-%d{yyyy-MM-dd}.gz"
type='RollingFile'
fileName='${log.dir}/warn.log'
>
Expand Down
6 changes: 6 additions & 0 deletions dspace/src/main/docker/dspace-postgres-pgcrypto/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ ENV POSTGRES_DB=dspace
ENV POSTGRES_USER=dspace
ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD}

# Create the log directory with the correct permissions
RUN mkdir -p /var/log/postgresql && chown postgres:postgres /var/log/postgresql

# Copy configuration with log rotation
COPY log.properties.conf /etc/postgresql/log.properties.conf

# Copy over script which will initialize database and install pgcrypto extension
COPY install-pgcrypto.sh /docker-entrypoint-initdb.d/
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Enable logging collector
logging_collector = on

# Where logs go (absolute path for Docker)
log_directory = '/var/log/postgresql'

# Log filename with date pattern for rotation
log_filename = 'postgresql-%Y-%m-%d.log'

# Rotate once per day
log_rotation_age = 1d

# No size-based rotation (0 = disabled)
log_rotation_size = 0

# Truncate old file when rotating with same name
log_truncate_on_rotation = on

# What to log
log_line_prefix = '%m [%p] %u@%d '
log_timezone = 'UTC'
4 changes: 2 additions & 2 deletions scripts/log4j2.solr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<RollingRandomAccessFile
name="MainLogFile"
fileName="${sys:solr.log.dir}/solr.log"
filePattern="${sys:solr.log.dir}/solr.log.%i" >
filePattern="${sys:solr.log.dir}/solr.log.%i.gz" >
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n
Expand All @@ -47,7 +47,7 @@
<RollingRandomAccessFile
name="SlowLogFile"
fileName="${sys:solr.log.dir}/solr_slow_requests.log"
filePattern="${sys:solr.log.dir}/solr_slow_requests.log.%i" >
filePattern="${sys:solr.log.dir}/solr_slow_requests.log.%i.gz" >
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%notEmpty{ =>%ex{short}}}{10240}%n
Expand Down