326 questions
0
votes
0
answers
31
views
How can I use log4cxx AsyncAppender with RollingFileAppender?
My Linux C++ application uses log4cxx and the RollingFileAppender. During normal application operations we sometimes see a few mSec program pause. This seems to occur at the same time as the time on ...
0
votes
0
answers
22
views
Logback roll over log files based on size not working
I have below config and its rolling policy is working to keep the file to max of 5 files.
But the triggering policy is getting triggered on random file sizes for rotation.
Not rotating on the exact ...
0
votes
0
answers
17
views
Can we customize RollinFileAppender for log4Net to achieve desired naming pattern
I want to achieve a specific naming pattern for the log files generated by RollingFileAppender.
my current configuration
<appender name="LiveTouchAppender" type="log4net.Appender....
0
votes
0
answers
36
views
Log4j2 configuration for Java application using Log4j2.properties file
I have an ETL application that runs every hour through a task scheduler. Whenever the ETL app starts the logfile needs to be generated named as ETL_LOG_<CURRENT_DATE_AND_TIMESTAMP>.log. The file ...
1
vote
0
answers
41
views
Log4j - file name index and rolling files
In our applications we use Log4j logger.
For our log files we have 2 requirements:
The files are written in different folders according to hour change(every hour I open a new folder)
The index in ...
0
votes
1
answer
106
views
Log4Cxx Blocks Calling Thread While Logging?
I'm using log4cxx::rolling::RollingFileAppender() for logging in my C++ application, without any asynchronous appenders. If I invoke logging from the main thread, will the main thread be blocked until ...
0
votes
1
answer
109
views
Why does Log4j OnStartupTriggeringPolicy check the file timestamp?
and/or "How does one safely handle context in a RollingFileAppender TriggeringPolicy?"
I am having problems with OnStartupTriggeringPolicy not fulfilling its stated purpose of
Triggers a ...
0
votes
0
answers
12
views
Rollingfileappender Generates some garbage values in log file
I am using below configuration file to generate logs.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorinterval="30" status="warn" strict=&...
0
votes
0
answers
43
views
log4j2: Using filename with digits in RollingFile appender
I have a log4j2 configuration, that just works fine.
But I want even the latest logfile to also have digits in the file name, so that the latest file is always on top.
Instead of this:
|-- Project
...
1
vote
1
answer
600
views
Spring Boot logback is creating tmp file but not deleting them
I'm having problem with my Logback in Java/Spring Boot application.
My Logback is keep creating large tmp files and it's taking over lots of disk usage.
This is how my RollingFileAppender in logback-...
1
vote
0
answers
107
views
ch.qos.logback.core.rolling.sizeandtimebasedrollingpolicy not honoring maxfilesize given
ch.qos.logback.core.rolling.sizeandtimebasedrollingpolicy with 10MB size is not generating new file after the size limit reached to 10MB.
sometimes it roll file at 12912KB and sometimes it goes upto ...
2
votes
0
answers
286
views
Log4j2 - integer counter %i not resetting with time AND size rolling
Using Log4j2 v2.18.0 I want to roll over the log file every hour or every 100 MB, so I'm using this:
<Appenders>
<RollingFile name="APPLICATION" filePattern="/path/to/log.%...
1
vote
1
answer
67
views
Migrating log4j to log4j2 2.17.X version. Recent log file as base file with format "fileNameyyyyMMdd_HHmmss_SSS.log"
I am migrating log4j to log4j2 2.17.X version. Logs file rollover when size is x MB. file rollover format is -%d{yyyyMMdd_HHmmss_SSS}. I am using below code:
RollingFileAppender.Builder rollbuilder = ...
0
votes
1
answer
360
views
How to update ${ctx:key} to achieve dynamic file name without executing log4j2 reconfigure()
Now I have problem with log4j2.
My goal is:
Determine which file to log according to the value of "fileName" in the MDC map.
For example
public class A {
void test() {
//log ...
0
votes
1
answer
485
views
SiftingAppender with no Default value discriminator
I use SiftingAppender and RollingFileAppender to separate log folders with a discriminator key.
<appender name="TEST_LOGGER" class="ch.qos.logback.classic.sift.SiftingAppender"&...
-1
votes
1
answer
125
views
log4net - RollingFileAppender
I am having an issue with log4net regarding the use of the rolling appender. When we have mutiple threads we create an RollingAppender to log messages to the default log file as well as a job specific ...
1
vote
0
answers
85
views
Reason behind limitation of Logback is creating only 22 log files with FixedWindowRollingPolicy
I would like to understand the logic and reason behind:
Logback is creating only 22 log files even if the max index is 300
I checked the source code :
https://github.com/qos-ch/logback/blob/master/...
1
vote
1
answer
405
views
RollingFile appender with file name to be determined at each logger invocation
I have a function which executes HTTP request/response and I would like to log the content of them.
Such code can be invoked multiple times within the same execution (classified by an "...
2
votes
0
answers
298
views
Databricks Log4J Custom Appender Not Working as expected
I'm trying to figure out how a custom appender should be configured in a Databricks environment but I cannot figure it out.
When cluster is running, in driver logs, time is displayed as 'unknown' for ...
5
votes
0
answers
4k
views
catalina.out daily rolling in Tomcat9
I have a default tomcat 9.0.37 installation. The catalina.out file in the server logs does not roll on a daily basis due to which its size has grown to several GBs.
However I observed that a file with ...
0
votes
1
answer
44
views
Log4j2 - 2 appenderFile. I use only one ref, but two files are generated (One of them are empty)
I have two appenders "RollingFile" like this :
<RollingFile name="fileDebug" fileName="${REP}/debug.log" filePattern="${REP}/debug-%d{yyyy-MM-dd}-%i.log">
...
2
votes
1
answer
735
views
Log4j difference between dollar and percent patterns in layout
Answering this this question about log4j2 left me more confused than enlightened.
There seem to be several ways of specifying the current date (with custom format) in log4j2 configuration files:
%d{...
0
votes
1
answer
1k
views
Issue in deleting a file created by rolling file using log4j2
I have configured the log4j2.xml file to delete files older than 2 minutes(for testing) to be deleted. This works fine but i am not able to delete the first file that is generated. After rollover, all ...
1
vote
0
answers
55
views
log4j2 starting from 1 after restarting application
Hi I am using log4j2 and using rollover based on time and size. I am using file name as Application.log ,when rollover happens , previous filename appends with index but after system restarts count ...
0
votes
0
answers
162
views
Rolling file Appender Missing some logs
I am using a Rolling File Appender and it creates new log files after the file size exceeds 3MB. But it does not add some logs. When I try to perform operations on UI, it doesn't gets logged. I am new ...
1
vote
1
answer
571
views
log4j2 replacement for RollingFileAppender that set log directory programmatically
We are upgrading our Java application from log4j 1x to 2x.
In 1x we had an extension to RollingFileAppender specified in log4j.properties. As well as rolling the files, it would compute the path of ...
0
votes
0
answers
176
views
Migrating from log4j to log4j2 below is my log4j2.properties file
The log4j2 is working as i expected but in case if the file size reaches 5kb i need the new file to generate with indexed suffix i.e abclogs.log.1, but in my case the files are generating in my local ...
0
votes
0
answers
430
views
Logs are logged into the rollingfile and not console after rollingfile appender got initalized
Below are the programmatic configurations of consoleAppender and LogAppenders which I have converted for log4j upgrade from 1.. to 2.17.1 version.
//Programmatic configuration of ConsoleAppender ...
1
vote
1
answer
806
views
Unable to instantiate RollingFileAppender
I am trying to create a RollingFileAppender through java code.
The below code always throws a null pointer Exception for the line appender.start() stating RollingFileAppender 'null': No name provided. ...
0
votes
1
answer
1k
views
log4j2 not logging to a file
Java 1.8, WebSphere Liberty 19.0.0.3 running in localhost, log4j v.2.17.1, Maven v.3.5.2
I have read some posts of similar issues, but I have not seen a solution that works for my case.
I cannot get ...
1
vote
0
answers
863
views
Missing logs while using RollingFile appender log4j2.xml
This is my lo4j2.xml file
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Properties>
<Property name="log.directory">${sys:...
3
votes
0
answers
212
views
Accessing log4cxx object initiailized in configuartion file
New to log4cxx. I have a configuration file where I define the log4cxx configuration. That works fine. What I want to do now is access an object defined in that config file and extend it's ...
1
vote
0
answers
445
views
Rollover logfile on startup and on time and size
Using logback, and its RollingFileAppender, how can I configure a log to roll over on time and size, but also on every application launch?
The following config generates a new log file on each day, ...
0
votes
1
answer
1k
views
log4j2 RollingFile not using date from log message for filePattern but current date
I'm working on a program that generatse logs with different date-times. This is done by logging messages create from a custom class that implements TimestampMessage.
I'm trying to output those logs ...
1
vote
0
answers
499
views
Tomcat log4j.xml and log4j2.xml rolling logs configured to delete old
I have an application and depending on the version it uses log4j.xml and log4j2.xml.
I have tried many ways but I cannot seem to have it only keep 30 Days of logs it continues to collect. Below are my ...
0
votes
0
answers
930
views
Application thread remains in WAITING state forever while using logback
In my application, I am using logback as a logging framework. The application isn't making progress. To troubleshoot, I took thread dumps (for approx 60 sec), and see the application thread remains in ...
4
votes
0
answers
1k
views
How to configure rolling serilog-sinks-file to keep the latest log file with the same name
I like to have an editor open with the latest log file, while my application is running.
I have a 10MB file size limit and Day as the rolling interval.
When the first file, say log-20210314.log fills ...
0
votes
2
answers
2k
views
Issue with filename in log4j2 rolling file appender
I have the following log4j2.xml configuration. I have a time as well as size based triggering policy. Since the size limit (10 MB) is breached first, the log file rolls over and while creating a new ...
1
vote
0
answers
141
views
how to map log data fields to base model in mongodb in useing mongo appender in log4j2.xml
i have a constant data model for a collection in mongo db and now i want map log data to my collection model.
my collection:
@Document(collection = "LOG")public class LogCollection {
@Field(&...
0
votes
1
answer
363
views
CocoaLumberjack - Swift : Deleting Old Logs all of sudden
We are using CocoaLumberjack(3.7.0) for implementing logging into application.
We want to keep max number of files to 90.
We are sure file size per day won't go beyond 100 MB.
So we referred below ...
1
vote
1
answer
3k
views
Log4j2 RollingFileAppender not writing logs to file
I have the following log4j2 config in log4j2.xml which is not writing logs to file. I'm using windows 10. What am I doing wrong?
<?xml version="1.0" encoding="UTF-8"?>
<...
0
votes
1
answer
1k
views
Log4j2.xml - Queue size and discardingThreshold
how can we specify the queue size and discardingThreshold for Asynchronous appenders in log4j2.xml
Below is sample snippet from logback.xml.
<appender name="appender1" class="ch.qos....
1
vote
1
answer
916
views
log4j2 RollingFileAppender after first rolling, each POD write exclusively current log file
I use log4j2 on a springboot web application with microservices deployed on openshift 3.11.
below the configuration of log4j2
<?xml version="1.0" encoding="UTF-8"?>
<...
0
votes
1
answer
4k
views
Log4j2 customize file path with rollingFileAppender (Java)
I am migrating from log4j 1.x to log4j2 in my spring boot application. Being on log4j 1.x I used to define the properties as follows:
log4j.appender.A1=package.CustomRollingFileAppender
log4j.appender....
8
votes
1
answer
12k
views
Migration from log4j to log4j2:the equivalent attribute to MaxFileSize and MaxBackupIndex
My question is regarding LoggerAppenderRollingFile in log4j. Due to some changes in project I have to upgarde to log4j2, and my question is what are the equivalnet attribute to "MaxFileSize",...
1
vote
1
answer
1k
views
Log4j2: Programatically remove the existing appenders and add new RollingFileAppender dynamically for all loggers
We have a requirement to add the rolling file appender programmatically in application startup.
And also I need to remove the existing appenders(which are configured from log4j2.xml file).
I tried ...
0
votes
1
answer
3k
views
No name attribute provided for Appender AchLog issue with log4j2
I have recently upgraded my application to log4j2.13.3. Below is my log4j properties file:
appenders=AchLog,AchLog1
appender.AchLog.type = Console
appender.AchLog.name = AchLog
appender.AchLog.target ...
0
votes
1
answer
1k
views
how to create log file under project base directory using log4j2
I wanted to create log file in my maven project under project base directory.I am using log4j2 framework kept the log4j2.xml file under src/mian/resources folder. below is the file. please update what ...
0
votes
1
answer
1k
views
Log4j2 Amazon ec2 file logging not working
I just converted my java server to use Log4j2 from 1.
My file logs worked just fine with Log4j1:
try {
Date currentStamp = new Date();
String sdf = new SimpleDateFormat("yyyy-MM-dd_HH.mm....
0
votes
1
answer
1k
views
Quartz.net scheduler logs via log4net not coming in correct logger file
I am working on a windows service and that service has five different jobs which runs at the same time as there is a scheduler which uses Quarts.Net and TopShelf library for scheduling these jobs at a ...