diff options
author | Jeff Ames | 2009-06-01 18:45:36 +0000 |
---|---|---|
committer | Jeff Ames | 2009-06-01 18:45:36 +0000 |
commit | c6f616049c8a4b925814b7edba97b8af77ca8ec1 (patch) | |
tree | 7a317743eabc671a63163eed44a2d29157ce2625 | |
parent | * Making silent logoff of old hung sessions for new connections default for (diff) | |
download | opensim-SC-c6f616049c8a4b925814b7edba97b8af77ca8ec1.zip opensim-SC-c6f616049c8a4b925814b7edba97b8af77ca8ec1.tar.gz opensim-SC-c6f616049c8a4b925814b7edba97b8af77ca8ec1.tar.bz2 opensim-SC-c6f616049c8a4b925814b7edba97b8af77ca8ec1.tar.xz |
Only save crashes to disk if save_crashes in OpenSim.ini is true (false by default).
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index c94483d..ff17086 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -160,27 +160,30 @@ namespace OpenSim | |||
160 | 160 | ||
161 | m_log.ErrorFormat("[APPLICATION]: {0}", msg); | 161 | m_log.ErrorFormat("[APPLICATION]: {0}", msg); |
162 | 162 | ||
163 | // Log exception to disk | 163 | if (m_saveCrashDumps) |
164 | try | ||
165 | { | 164 | { |
166 | if (!Directory.Exists(m_crashDir)) | 165 | // Log exception to disk |
166 | try | ||
167 | { | 167 | { |
168 | Directory.CreateDirectory(m_crashDir); | 168 | if (!Directory.Exists(m_crashDir)) |
169 | } | 169 | { |
170 | string log = Util.GetUniqueFilename(ex.GetType() + ".txt"); | 170 | Directory.CreateDirectory(m_crashDir); |
171 | StreamWriter m_crashLog = | 171 | } |
172 | new StreamWriter( | 172 | string log = Util.GetUniqueFilename(ex.GetType() + ".txt"); |
173 | Path.Combine(m_crashDir, log) | 173 | StreamWriter m_crashLog = |
174 | ); | 174 | new StreamWriter( |
175 | Path.Combine(m_crashDir, log) | ||
176 | ); | ||
175 | 177 | ||
176 | m_crashLog.WriteLine(msg); | 178 | m_crashLog.WriteLine(msg); |
177 | m_crashLog.Close(); | 179 | m_crashLog.Close(); |
178 | 180 | ||
179 | File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true); | 181 | File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true); |
180 | } | 182 | } |
181 | catch (Exception e2) | 183 | catch (Exception e2) |
182 | { | 184 | { |
183 | m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2); | 185 | m_log.ErrorFormat("[CRASH LOGGER CRASHED]: {0}", e2); |
186 | } | ||
184 | } | 187 | } |
185 | 188 | ||
186 | _IsHandlingException = false; | 189 | _IsHandlingException = false; |