Hello Micha�l ,

I checked out the latest code and test it, however it still has a problem.
It is because "filename" on the line 83 is not "fileName" in "rollingfileappender.cpp".
Could you fix and update the source code?


Here's one of the possible modifications. (Any kind of fix that works well are welcome for me.)


*************** *** 61,88 **** USES_CONVERSION; remove(T2A(file.str().c_str()));

! // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
! for (int i = maxBackupIndex - 1; i >= 1; i--)
{
StringBuffer file;
StringBuffer target;


! file << fileName << _T(".") << i;
target << fileName << _T(".") << (i + 1);
LogLog::debug(_T("Renaming file ") + file.str() + _T(" to ") + target.str());
std::string aFileName = T2A(file.str().c_str());
std::string aTarget = T2A(target.str().c_str());
rename(aFileName.c_str(), aTarget.c_str());
}
-
- // Rename fileName to fileName.1
- StringBuffer target;
- target << fileName << _T(".") << 1;
-
- LogLog::debug(_T("Renaming file ") + fileName + _T(" to ") + target.str());
- std::string aFileName = T2A(file.str().c_str());
- std::string aTarget = T2A(target.str().c_str());
- rename(aFileName.c_str(), aTarget.c_str());
}


     // Open the current file up again in truncation mode
--- 61,83 ----
         USES_CONVERSION;
         remove(T2A(file.str().c_str()));

! // Map {(maxBackupIndex - 1), ..., 2, 1, 0} to {maxBackupIndex, ..., 3, 2, 1}
! for (int i = maxBackupIndex - 1; i >= 0; i--)
{
StringBuffer file;
StringBuffer target;


! if (i != 0) {
! file << fileName << _T(".") << i;
! } else {
! file << fileName;
! }
target << fileName << _T(".") << (i + 1);
LogLog::debug(_T("Renaming file ") + file.str() + _T(" to ") + target.str());
std::string aFileName = T2A(file.str().c_str());
std::string aTarget = T2A(target.str().c_str());
rename(aFileName.c_str(), aTarget.c_str());
}
}


     // Open the current file up again in truncation mode


Tomoya

Michael CATANZARITI wrote:

Hello Tomoya,

Yes it's possible to yse log4cxx with MFC !

about the rollingfileappender, I fixed the problem and committed the correction in CVS.
See http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgNo=74


for more details.

Micha�l

Tomoya Sueyoshi wrote:

Hello Micha�l,

Yes, I did compile with an Unicode target, because my program is a dialog based application using MFC and also /Zc:wchar_t option.

Here are my compile/link options and a piece of VC project setting.

p.s. Is it possible to use log4cxx with MFC dialog based application?

[compile]
/Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "DLL_EXPORTS" /D "UNICODE" /D "LOG4CXX" /D "LOG4CXX_DLL" /D "_WINDLL" /D "_UNICODE" /FD /EHsc /RTC1 /MDd /GS /Zc:wchar_t /YX"stdafx.h" /Fp".\Unicode_D/dll.pch" /Fo".\Unicode_D/" /Fd".\Unicode_D/" /FR".\Unicode_D/" /W3 /nologo /c /Zi


[link]
/OUT:"../Bin/Unicode_D/log4cxx.dll" /INCREMENTAL:NO /NOLOGO /DLL /DEBUG /PDB:"../Bin/Unicode_D/log4cxx.pdb" /MAP:".\Unicode_D/log4cxx.map" /IMPLIB:"../Lib/Unicode_D/log4cxx.lib" /MACHINE:X86 Ws2_32.lib odbc32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib


[dll.vcproj]
<Configuration
    Name="Unicode Debug|Win32"
    OutputDirectory=".\Unicode_D"
    IntermediateDirectory=".\Unicode_D"
    ConfigurationType="2"
    UseOfMFC="0"
    ATLMinimizesCRunTimeLibraryUsage="FALSE"
    CharacterSet="1">




__________________________________________________ Do You Yahoo!? http://bb.yahoo.co.jp/



Reply via email to