Comments (3)
Hello,
Append logs to an existing file in S3
The selection of the key name in S3 currently takes into account the date/time, host name, and an application-specific ID to avoid name clash and nasty concurrency issues when multiple hosts/processes are appending to the same destination (just imagine two threads writing to a file). There is also a possible performance hit (unless there is an S3 feature to append that I don't know about) of having to download the content of the key, append to it, then upload it back into the same key.
Honestly I can't think of a good solution to these challenges off of the top of my head. Perhaps if you can elaborate on what problem you're trying to solve by having these logs go into a preexisting file, I can try to figure something out.
compress output before storing in S3
This is definitely doable. I will look into it. I believe there is already support in Java for this.
from log4j-s3-search.
re appending logs, the motivation is mainly to reduce the amount of files that get generated in the bucket. Just googling now it's clear s3 does not support in place file appending so I guess it's not an option. Downloading & overwriting would work but inefficient I guess.
Thanks anyway!
from log4j-s3-search.
Oh I see what you mean. You can mitigate the number of keys used somewhat by increasing the log4j.appender.S3Appender.stagingBufferSize
or log4j.appender.S3Appender.stagingBufferAge
.
But it won't solve the problem completely because at some threshold value the buffer will take on too much memory (and the eventual flush/publish will be more risky due to potential of network errors). That may be mitigated further by using local files instead of an in-memory buffer as it does now, but it is still susceptible to loss of content if something goes wrong while uploading a "huge" file to S3. Maybe with compression we can push the envelope a bit more.
So perhaps out of this are two features worth looking into:
- Using a file in the local file system instead of in-memory buffer. Slightly more cumbersome since now we have to worry about IO errors, but nothing is ever free, is it? :-)
- Compressing log data
from log4j-s3-search.
Related Issues (20)
- Minio support. HOT 3
- AWS S3 - lack of data compression HOT 3
- Thread Count - keep increase HOT 2
- Cannot end publish with com.van.logging.azure.BlobPublishHelper HOT 3
- System out in S3PublishHelper.java HOT 2
- Cannot end publish with com.van.logging.aws.S3PublishHelper HOT 13
- Thread pool executer shutdown not being called. HOT 3
- Compatibility with / Benchmarking with Asynchronous logging HOT 1
- Security dependencies bump HOT 2
- Call to Exception.printStackTrace() causes Log4j2 to split stacktrace logs HOT 2
- Support AWS IRSA. HOT 3
- Flushing out remaining events in the cache on shutdown HOT 15
- Refresh "s3Path" setting for S3Appender based on configuration HOT 13
- spark-submit hangs after successful job completion HOT 11
- LoggingEventCache shutdown hangs with <stagingBufferAge> set HOT 6
- Issues preventing logging to storage grid HOT 11
- While using the log4j2.xml configurations for Gcp bucket I am getting invalid attributes error HOT 7
- Error processing element Log4j2Appender ([Appenders: null]): CLASS_NOT_FOUND HOT 5
- Elastic Search HOT 9
- Support Property Substitution on Path/Prefix. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log4j-s3-search.