You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Somashekhar (Jira)" <lo...@logging.apache.org> on 2020/11/29 07:05:00 UTC

[jira] [Comment Edited] (LOGCXX-513) Time based rolling is not working on Windows 10

    [ https://issues.apache.org/jira/browse/LOGCXX-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240190#comment-17240190 ] 

Somashekhar edited comment on LOGCXX-513 at 11/29/20, 7:04 AM:
---------------------------------------------------------------

Hi,

I apologize for delay.

I tested with 0.11.0 and getting same error. Captured details as explained by you. 
 At the time of file rollover getting error 3 from GetLastError() which is equal to *ERROR_PATH_NOT_FOUND(*The system cannot find the path specified.) Same error is seen in Process monitor as well.

 

Please find [^Logfile.PML] event logs.

I started process at around 11.52 AM, at 12 PM while generating new file with folder it caused error.
 My folder structure looks like below,
 At 11.52 = "D:\URAP\Repo\URAP\Development\Source\Log4cxx\20201129\11\uRAP\test.log" (Created this successfully on launch)

At 12, expecting "D:\URAP\Repo\URAP\Development\Source\Log4cxx\20201129\12\uRAP\test.log" (Failed to create on rollover)

Means want to create folder for every hour.

*CreateFileW*() system call is failing, in this return value from call is '0xffffffffffffffff', and apr_get_os_error() after this call is returning '720003'.
 Please find *Log4cxx_error.png* for calls and call stack details. 

Please let me know if you need any details. 

 **  


was (Author: somashekhargg@gmail.com):
Hi,

I apologize for delay.

I am able to capture details as explained by you. 
At the time of file rollover getting error 3 from GetLastError() which is equal to *ERROR_PATH_NOT_FOUND(*The system cannot find the path specified.) Same error is seen in Process monitor as well.

 

Please find [^Logfile.PML] event logs.

I started process at around 11.52 AM, at 12 PM while generating new file with folder it caused error.
My folder structure looks like below,
At 11.52 = "D:\URAP\Repo\URAP\Development\Source\Log4cxx\20201129\11\uRAP\test.log" (Created this successfully on launch)

At 12, expecting "D:\URAP\Repo\URAP\Development\Source\Log4cxx\20201129\12\uRAP\test.log" (Failed to create on rollover)

Means want to create folder for every hour.

*CreateFileW*() system call is failing, in this return value from call is '0xffffffffffffffff', and apr_get_os_error() after this call is returning '720003'.
Please find *Log4cxx_error.png* for calls and call stack details. 


Please let me know if you need any details. 

 **  

> Time based rolling is not working on Windows 10
> -----------------------------------------------
>
>                 Key: LOGCXX-513
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-513
>             Project: Log4cxx
>          Issue Type: Bug
>          Components: Appender, Core
>    Affects Versions: 0.10.0
>         Environment: Windows 10, Visual studio 2019
>            Reporter: Somashekhar
>            Priority: Blocker
>         Attachments: Log4cxx_Test.log, Log4cxx_error.png, Logfile.PML
>
>
> Hi,
> I am able to build log4cxx with following apr, apr-util and libexpat versions using Visual Studio 2019 on Windows 10 for both 32 bit and 64 bit(Disabled libiconv). apr-1.7.0, APR-util 1.6.1, log4cxx-0.10.0 and libexpat-R_2_2_10
> Tested these libraries with below code,
>  
> {{log4cxx::DailyRollingFileAppenderPtr debugRollingFileAppender1(new \
>         log4cxx::DailyRollingFileAppender());    //Create the date pattern in the folder structure.std::string aDatePattern = std::string("D:\\LogFolder\\Log4cxx_2019_Test\\") + "%Y%m%d\\%H\\" + "test" + ".log";
>     LOG4CXX_DECODE_CHAR(aTempLogDatePattern, aDatePattern);
>     debugRollingFileAppender1->setDatePattern(aTempLogDatePattern);
>     log4cxx::helpers::Pool pool;    log4cxx::PatternLayoutPtr debugLayout(new log4cxx::PatternLayout());
>     debugLayout->setConversionPattern(LOG4CXX_STR("%d   [%t]    %5p %m%n"));
>     debugRollingFileAppender1->setLayout(debugLayout);
>     debugRollingFileAppender1->activateOptions(pool);
>     LoggerPtr logger = Logger::getLogger(_T("LogInfo"));
>     logger->addAppender(debugRollingFileAppender1);
>     logger->setLevel(Level::getInfo());}}
>  
> While rolling over application is throwing exception "log4cxx: Exception during rollover", and after debugging found that below call in file "apr\file_io\win32\open.c" is failing to create the file. I thought it could be permission issue, but first time on application launch it is able to create file. It is failing only while rollover.
> handle = CreateFileA(fname, oflags, sharemode,
>  NULL, createflags, attributes, 0); 
>  
> Please let me know if you need more details.
> Thanks



--
This message was sent by Atlassian Jira
(v8.3.4#803005)