COMPRESS LOG FOLDER ON DSPACE

36 views
Skip to first unread message

Gerald Okeke

unread,
Jun 28, 2024, 5:38:26 PMJun 28
to DSpace Technical Support
Greetings,

Please I need assistance on how to compress the log folder in Dspace. 

My server is out of storage. I realise that this folder has over 56gb of storage. 

How can I compress it without affecting my dspace application?.

Looking forward to hearing from you.

Best Regards
Gerald

DSpace Technical Support

unread,
Jul 10, 2024, 5:59:40 PM (12 days ago) Jul 10
to DSpace Technical Support
Hi Gerald,

DSpace will only use the latest log file at any given time.  This latest log file is just called "dspace.log" and is located in the "log" folder.  Any older logs (usually these have a suffix like "dspace.log-[date]") can be safely compressed/zipped without impacting DSpace's behavior.

Tim

Gerald Okeke

unread,
Jul 10, 2024, 6:17:24 PM (11 days ago) Jul 10
to DSpace Technical Support

Hi Tim,

Thank you so much. If I compress and zip can I transfer it out of my production server to a storage server somewhere else?


--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/eea0302c-e59a-476a-81ca-f6cda7ce4d23n%40googlegroups.com.

Abel Gómez

unread,
Jul 10, 2024, 7:59:58 PM (11 days ago) Jul 10
to DSpace Technical Support
Hi Gerald,

if I'm not wrong, you can automatically zip your log files when they are rotated by modifying the log4j2 configuration. That would save you from manually zipping them periodically.

Edit the `config/log4j2.xml` file, and set the extension in the filePattern property to 'gz'. E.g.:

filePattern="${log.dir}/dspace.log-%d{yyyy-MM-dd}.gz"

Tim, maybe, should the default config be changed to compress the old log files by default?

Cheers,

Abel

mw...@iu.edu

unread,
Jul 11, 2024, 11:30:45 AM (11 days ago) Jul 11
to dspac...@googlegroups.com
On Wed, Jul 10, 2024 at 11:59:58PM +0000, Abel Gómez wrote:
> if I'm not wrong, you can automatically zip your log files when they are rotated by modifying the log4j2 configuration. That would save you from manually zipping them periodically.
>
> Edit the `config/log4j2.xml` file, and set the extension in the filePattern property to 'gz'. E.g.:
>
> filePattern="${log.dir}/dspace.log-%d{yyyy-MM-dd}.gz"
>
> Tim, maybe, should the default config be changed to compress the old log files by default?

A good idea.

We take a different approach here: we have a nightly cron job that
moves older logs to a Zip archive, leaving the last couple of days in
case we want to inspect recent messages without unpacking.

You can combine approaches: let Log4J compress the logs at rotation
and later a cron job simply stores them in an archive or whatever.
I've done that with another product.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
library.indianapolis.iu.edu
signature.asc

DSpace Technical Support

unread,
Jul 15, 2024, 12:13:19 PM (7 days ago) Jul 15
to DSpace Technical Support
Hi Abel,

I'd welcome the approach of setting this up better "by default".  Feel free to send a PR if you've found an easier way to achieve this using the standard log4j2 configuration.  DSpace is built/maintained entirely by community volunteers, so I don't have a developer team to assign tasks to.  We rely on individuals to contribute back useful improvements.  See our contribution guidelines (for the backend) for more details: https://github.com/DSpace/DSpace/blob/main/CONTRIBUTING.md

Tim
Reply all
Reply to author
Forward
0 new messages