diff options
Diffstat (limited to 'OpenSim/Grid/InventoryServer/Main.cs')
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index b62c696..5037c7d 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -38,6 +38,8 @@ namespace OpenSim.Grid.InventoryServer | |||
38 | { | 38 | { |
39 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback | 39 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback |
40 | { | 40 | { |
41 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
42 | |||
41 | private InventoryManager m_inventoryManager; | 43 | private InventoryManager m_inventoryManager; |
42 | private InventoryConfig m_config; | 44 | private InventoryConfig m_config; |
43 | private GridInventoryService m_inventoryService; | 45 | private GridInventoryService m_inventoryService; |
@@ -47,6 +49,8 @@ namespace OpenSim.Grid.InventoryServer | |||
47 | [STAThread] | 49 | [STAThread] |
48 | public static void Main(string[] args) | 50 | public static void Main(string[] args) |
49 | { | 51 | { |
52 | log4net.Config.XmlConfigurator.Configure(); | ||
53 | |||
50 | OpenInventory_Main theServer = new OpenInventory_Main(); | 54 | OpenInventory_Main theServer = new OpenInventory_Main(); |
51 | theServer.Startup(); | 55 | theServer.Startup(); |
52 | 56 | ||
@@ -55,20 +59,20 @@ namespace OpenSim.Grid.InventoryServer | |||
55 | 59 | ||
56 | public OpenInventory_Main() | 60 | public OpenInventory_Main() |
57 | { | 61 | { |
58 | m_log = new LogBase("opengrid-inventory-console.log", LogName, this, true); | 62 | m_console = new ConsoleBase(LogName, this); |
59 | MainLog.Instance = m_log; | 63 | MainConsole.Instance = m_console; |
60 | } | 64 | } |
61 | 65 | ||
62 | public void Startup() | 66 | public void Startup() |
63 | { | 67 | { |
64 | MainLog.Instance.Notice("Initialising inventory manager..."); | 68 | m_log.Info("Initialising inventory manager..."); |
65 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); | 69 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); |
66 | 70 | ||
67 | m_inventoryService = new GridInventoryService(); | 71 | m_inventoryService = new GridInventoryService(); |
68 | // m_inventoryManager = new InventoryManager(); | 72 | // m_inventoryManager = new InventoryManager(); |
69 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); | 73 | m_inventoryService.AddPlugin(m_config.DatabaseProvider); |
70 | 74 | ||
71 | MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); | 75 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); |
72 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | 76 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); |
73 | httpServer.AddStreamHandler( | 77 | httpServer.AddStreamHandler( |
74 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", | 78 | new RestDeserialisehandler<Guid, InventoryCollection>("POST", "/GetInventory/", |
@@ -95,19 +99,19 @@ namespace OpenSim.Grid.InventoryServer | |||
95 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", | 99 | new RestDeserialisehandler<Guid, List<InventoryFolderBase>>("POST", "/RootFolders/", |
96 | m_inventoryService.RequestFirstLevelFolders)); | 100 | m_inventoryService.RequestFirstLevelFolders)); |
97 | 101 | ||
98 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); | 102 | // httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); |
99 | 103 | ||
100 | httpServer.Start(); | 104 | httpServer.Start(); |
101 | MainLog.Instance.Notice(LogName, "Started HTTP server"); | 105 | m_log.Info("[" + LogName + "]: Started HTTP server"); |
102 | } | 106 | } |
103 | 107 | ||
104 | private void Work() | 108 | private void Work() |
105 | { | 109 | { |
106 | m_log.Notice("Enter help for a list of commands\n"); | 110 | m_console.Notice("Enter help for a list of commands\n"); |
107 | 111 | ||
108 | while (true) | 112 | while (true) |
109 | { | 113 | { |
110 | m_log.MainLogPrompt(); | 114 | m_console.Prompt(); |
111 | } | 115 | } |
112 | } | 116 | } |
113 | 117 | ||
@@ -122,7 +126,7 @@ namespace OpenSim.Grid.InventoryServer | |||
122 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); | 126 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); |
123 | break; | 127 | break; |
124 | case "shutdown": | 128 | case "shutdown": |
125 | m_log.Close(); | 129 | m_console.Close(); |
126 | Environment.Exit(0); | 130 | Environment.Exit(0); |
127 | break; | 131 | break; |
128 | } | 132 | } |