diff options
author | Jeff Ames | 2008-02-05 19:44:27 +0000 |
---|---|---|
committer | Jeff Ames | 2008-02-05 19:44:27 +0000 |
commit | 6ed5283bc06a62f38eb517e67b975832b603bf61 (patch) | |
tree | e5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Framework/Servers | |
parent | Cut down on the number of packets sent during terraforming. Terraforming shou... (diff) | |
download | opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.zip opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2 opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz |
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O.
This is mostly an in-place conversion, so lots of refactoring can still be done.
Diffstat (limited to 'OpenSim/Framework/Servers')
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 30 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 12 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/CheckSumServer.cs | 4 |
3 files changed, 23 insertions, 23 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index df3b049..cc0c0d0 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Framework.Servers | |||
41 | { | 41 | { |
42 | public class BaseHttpServer | 42 | public class BaseHttpServer |
43 | { | 43 | { |
44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
44 | protected Thread m_workerThread; | 46 | protected Thread m_workerThread; |
45 | protected HttpListener m_httpListener; | 47 | protected HttpListener m_httpListener; |
46 | protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>(); | 48 | protected Dictionary<string, XmlRpcMethod> m_rpcHandlers = new Dictionary<string, XmlRpcMethod>(); |
@@ -296,7 +298,7 @@ namespace OpenSim.Framework.Servers | |||
296 | } | 298 | } |
297 | catch (Exception ex) | 299 | catch (Exception ex) |
298 | { | 300 | { |
299 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 301 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
300 | } | 302 | } |
301 | finally | 303 | finally |
302 | { | 304 | { |
@@ -319,7 +321,7 @@ namespace OpenSim.Framework.Servers | |||
319 | LLSD llsdResponse = null; | 321 | LLSD llsdResponse = null; |
320 | 322 | ||
321 | try { llsdRequest = LLSDParser.DeserializeXml(requestBody); } | 323 | try { llsdRequest = LLSDParser.DeserializeXml(requestBody); } |
322 | catch (Exception ex) { MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); } | 324 | catch (Exception ex) { m_log.Warn("[HTTPD]: Error - " + ex.Message); } |
323 | 325 | ||
324 | if (llsdRequest != null && m_llsdHandler != null) | 326 | if (llsdRequest != null && m_llsdHandler != null) |
325 | { | 327 | { |
@@ -348,7 +350,7 @@ namespace OpenSim.Framework.Servers | |||
348 | } | 350 | } |
349 | catch (Exception ex) | 351 | catch (Exception ex) |
350 | { | 352 | { |
351 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 353 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
352 | } | 354 | } |
353 | finally | 355 | finally |
354 | { | 356 | { |
@@ -396,7 +398,7 @@ namespace OpenSim.Framework.Servers | |||
396 | 398 | ||
397 | foreach (string headername in rHeaders) | 399 | foreach (string headername in rHeaders) |
398 | { | 400 | { |
399 | //MainLog.Instance.Warn("HEADER", headername + "=" + request.Headers[headername]); | 401 | //m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]); |
400 | headervals[headername] = request.Headers[headername]; | 402 | headervals[headername] = request.Headers[headername]; |
401 | } | 403 | } |
402 | 404 | ||
@@ -407,9 +409,9 @@ namespace OpenSim.Framework.Servers | |||
407 | 409 | ||
408 | if (keysvals.Contains("method")) | 410 | if (keysvals.Contains("method")) |
409 | { | 411 | { |
410 | //MainLog.Instance.Warn("HTTP", "Contains Method"); | 412 | //m_log.Warn("[HTTP]: Contains Method"); |
411 | string method = (string) keysvals["method"]; | 413 | string method = (string) keysvals["method"]; |
412 | //MainLog.Instance.Warn("HTTP", requestBody); | 414 | //m_log.Warn("[HTTP]: " + requestBody); |
413 | GenericHTTPMethod requestprocessor; | 415 | GenericHTTPMethod requestprocessor; |
414 | bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); | 416 | bool foundHandler = TryGetHTTPHandler(method, out requestprocessor); |
415 | if (foundHandler) | 417 | if (foundHandler) |
@@ -422,13 +424,13 @@ namespace OpenSim.Framework.Servers | |||
422 | } | 424 | } |
423 | else | 425 | else |
424 | { | 426 | { |
425 | //MainLog.Instance.Warn("HTTP", "Handler Not Found"); | 427 | //m_log.Warn("[HTTP]: Handler Not Found"); |
426 | SendHTML404(response, host); | 428 | SendHTML404(response, host); |
427 | } | 429 | } |
428 | } | 430 | } |
429 | else | 431 | else |
430 | { | 432 | { |
431 | //MainLog.Instance.Warn("HTTP", "No Method specified"); | 433 | //m_log.Warn("[HTTP]: No Method specified"); |
432 | SendHTML404(response, host); | 434 | SendHTML404(response, host); |
433 | } | 435 | } |
434 | } | 436 | } |
@@ -461,7 +463,7 @@ namespace OpenSim.Framework.Servers | |||
461 | } | 463 | } |
462 | catch (Exception ex) | 464 | catch (Exception ex) |
463 | { | 465 | { |
464 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 466 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
465 | } | 467 | } |
466 | finally | 468 | finally |
467 | { | 469 | { |
@@ -488,7 +490,7 @@ namespace OpenSim.Framework.Servers | |||
488 | } | 490 | } |
489 | catch (Exception ex) | 491 | catch (Exception ex) |
490 | { | 492 | { |
491 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 493 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
492 | } | 494 | } |
493 | finally | 495 | finally |
494 | { | 496 | { |
@@ -513,7 +515,7 @@ namespace OpenSim.Framework.Servers | |||
513 | } | 515 | } |
514 | catch (Exception ex) | 516 | catch (Exception ex) |
515 | { | 517 | { |
516 | MainLog.Instance.Warn("HTTPD", "Error - " + ex.Message); | 518 | m_log.Warn("[HTTPD]: Error - " + ex.Message); |
517 | } | 519 | } |
518 | finally | 520 | finally |
519 | { | 521 | { |
@@ -523,7 +525,7 @@ namespace OpenSim.Framework.Servers | |||
523 | 525 | ||
524 | public void Start() | 526 | public void Start() |
525 | { | 527 | { |
526 | MainLog.Instance.Verbose("HTTPD", "Starting up HTTP Server"); | 528 | m_log.Info("[HTTPD]: Starting up HTTP Server"); |
527 | 529 | ||
528 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); | 530 | m_workerThread = new Thread(new ThreadStart(StartHTTP)); |
529 | m_workerThread.IsBackground = true; | 531 | m_workerThread.IsBackground = true; |
@@ -534,7 +536,7 @@ namespace OpenSim.Framework.Servers | |||
534 | { | 536 | { |
535 | try | 537 | try |
536 | { | 538 | { |
537 | MainLog.Instance.Verbose("HTTPD", "Spawned main thread OK"); | 539 | m_log.Info("[HTTPD]: Spawned main thread OK"); |
538 | m_httpListener = new HttpListener(); | 540 | m_httpListener = new HttpListener(); |
539 | 541 | ||
540 | if (!m_ssl) | 542 | if (!m_ssl) |
@@ -556,7 +558,7 @@ namespace OpenSim.Framework.Servers | |||
556 | } | 558 | } |
557 | catch (Exception e) | 559 | catch (Exception e) |
558 | { | 560 | { |
559 | MainLog.Instance.Warn("HTTPD", "Error - " + e.Message); | 561 | m_log.Warn("[HTTPD]: Error - " + e.Message); |
560 | } | 562 | } |
561 | } | 563 | } |
562 | 564 | ||
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 3016715..4831446 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -27,7 +27,6 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | |||
31 | using OpenSim.Framework.Console; | 30 | using OpenSim.Framework.Console; |
32 | 31 | ||
33 | namespace OpenSim.Framework.Servers | 32 | namespace OpenSim.Framework.Servers |
@@ -37,8 +36,7 @@ namespace OpenSim.Framework.Servers | |||
37 | /// </summary> | 36 | /// </summary> |
38 | public abstract class BaseOpenSimServer | 37 | public abstract class BaseOpenSimServer |
39 | { | 38 | { |
40 | protected LogBase m_log; | 39 | protected ConsoleBase m_console; |
41 | |||
42 | protected DateTime m_startuptime; | 40 | protected DateTime m_startuptime; |
43 | 41 | ||
44 | public BaseOpenSimServer() | 42 | public BaseOpenSimServer() |
@@ -56,7 +54,7 @@ namespace OpenSim.Framework.Servers | |||
56 | switch (command) | 54 | switch (command) |
57 | { | 55 | { |
58 | case "help": | 56 | case "help": |
59 | m_log.Notice("show uptime - show server startup and uptime."); | 57 | m_console.Notice("show uptime - show server startup and uptime."); |
60 | break; | 58 | break; |
61 | 59 | ||
62 | case "show": | 60 | case "show": |
@@ -77,8 +75,8 @@ namespace OpenSim.Framework.Servers | |||
77 | switch (ShowWhat) | 75 | switch (ShowWhat) |
78 | { | 76 | { |
79 | case "uptime": | 77 | case "uptime": |
80 | m_log.Notice("Server has been running since " + m_startuptime.ToString()); | 78 | m_console.Notice("Server has been running since " + m_startuptime.ToString()); |
81 | m_log.Notice("That is " + (DateTime.Now - m_startuptime).ToString()); | 79 | m_console.Notice("That is " + (DateTime.Now - m_startuptime).ToString()); |
82 | break; | 80 | break; |
83 | } | 81 | } |
84 | } | 82 | } |
diff --git a/OpenSim/Framework/Servers/CheckSumServer.cs b/OpenSim/Framework/Servers/CheckSumServer.cs index 47b3f24..6599d86 100644 --- a/OpenSim/Framework/Servers/CheckSumServer.cs +++ b/OpenSim/Framework/Servers/CheckSumServer.cs | |||
@@ -31,7 +31,7 @@ namespace OpenSim.Framework.Servers | |||
31 | /* | 31 | /* |
32 | public class CheckSumServer : UDPServerBase | 32 | public class CheckSumServer : UDPServerBase |
33 | { | 33 | { |
34 | //protected ConsoleBase m_log; | 34 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
35 | 35 | ||
36 | public CheckSumServer(int port) | 36 | public CheckSumServer(int port) |
37 | : base(port) | 37 | : base(port) |
@@ -114,7 +114,7 @@ namespace OpenSim.Framework.Servers | |||
114 | } | 114 | } |
115 | catch (Exception) | 115 | catch (Exception) |
116 | { | 116 | { |
117 | MainLog.Instance.Warn("CheckSumServer.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); | 117 | m_log.Warn("CheckSumServer.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); |
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||