summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/logger.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index d3dfc1224..8c9d9a79b 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -94,7 +94,11 @@ void LogManager::OpenFileLogs()
std::map<std::string, FileWriter*>::iterator fwi = logmap.find(target);
if (fwi == logmap.end())
{
- FILE* f = fopen(target.c_str(), "a");
+ char realtarget[MAXBUF];
+ time_t time = ServerInstance->Time();
+ struct tm *mytime = gmtime(&time);
+ strftime(realtarget, MAXBUF, target.c_str(), mytime);
+ FILE* f = fopen(realtarget, "a");
fw = new FileWriter(f);
logmap.insert(std::make_pair(target, fw));
}