aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs17
-rw-r--r--OpenSim/Framework/Util.cs15
2 files changed, 31 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index 8965e71..f627ae6 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -57,6 +57,7 @@ namespace OpenSim.Framework.Servers
57 57
58 protected OpenSimAppender m_consoleAppender; 58 protected OpenSimAppender m_consoleAppender;
59 protected FileAppender m_logFileAppender; 59 protected FileAppender m_logFileAppender;
60 protected FileAppender m_statsLogFileAppender;
60 61
61 protected DateTime m_startuptime; 62 protected DateTime m_startuptime;
62 protected string m_startupDirectory = Environment.CurrentDirectory; 63 protected string m_startupDirectory = Environment.CurrentDirectory;
@@ -156,6 +157,10 @@ namespace OpenSim.Framework.Servers
156 { 157 {
157 m_logFileAppender = (FileAppender)appender; 158 m_logFileAppender = (FileAppender)appender;
158 } 159 }
160 else if (appender.Name == "StatsLogFileAppender")
161 {
162 m_statsLogFileAppender = (FileAppender)appender;
163 }
159 } 164 }
160 165
161 if (null == m_consoleAppender) 166 if (null == m_consoleAppender)
@@ -185,6 +190,18 @@ namespace OpenSim.Framework.Servers
185 190
186 m_log.InfoFormat("[SERVER BASE]: Logging started to file {0}", m_logFileAppender.File); 191 m_log.InfoFormat("[SERVER BASE]: Logging started to file {0}", m_logFileAppender.File);
187 } 192 }
193
194 if (m_statsLogFileAppender != null && startupConfig != null)
195 {
196 string cfgStatsFileName = startupConfig.GetString("StatsLogFile", null);
197 if (cfgStatsFileName != null)
198 {
199 m_statsLogFileAppender.File = cfgStatsFileName;
200 m_statsLogFileAppender.ActivateOptions();
201 }
202
203 m_log.InfoFormat("[SERVER BASE]: Stats Logging started to file {0}", m_statsLogFileAppender.File);
204 }
188 } 205 }
189 206
190 /// <summary> 207 /// <summary>
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 0037f4f..dcb660a 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1190,7 +1190,7 @@ namespace OpenSim.Framework
1190 { 1190 {
1191 foreach (IAppender appender in LogManager.GetRepository().GetAppenders()) 1191 foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
1192 { 1192 {
1193 if (appender is FileAppender) 1193 if (appender is FileAppender && appender.Name == "LogFileAppender")
1194 { 1194 {
1195 return ((FileAppender)appender).File; 1195 return ((FileAppender)appender).File;
1196 } 1196 }
@@ -1199,6 +1199,19 @@ namespace OpenSim.Framework
1199 return "./OpenSim.log"; 1199 return "./OpenSim.log";
1200 } 1200 }
1201 1201
1202 public static string statsLogFile()
1203 {
1204 foreach (IAppender appender in LogManager.GetRepository().GetAppenders())
1205 {
1206 if (appender is FileAppender && appender.Name == "StatsLogFileAppender")
1207 {
1208 return ((FileAppender)appender).File;
1209 }
1210 }
1211
1212 return "./OpenSimStats.log";
1213 }
1214
1202 public static string logDir() 1215 public static string logDir()
1203 { 1216 {
1204 return Path.GetDirectoryName(logFile()); 1217 return Path.GetDirectoryName(logFile());