diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/AssetServer/RestService.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs index 5c497b6..cb9e1ae 100644 --- a/OpenSim/Grid/AssetServer/RestService.cs +++ b/OpenSim/Grid/AssetServer/RestService.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Grid.AssetServer | |||
41 | { | 41 | { |
42 | public class GetAssetStreamHandler : BaseStreamHandler | 42 | public class GetAssetStreamHandler : BaseStreamHandler |
43 | { | 43 | { |
44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
44 | private OpenAsset_Main m_assetManager; | 46 | private OpenAsset_Main m_assetManager; |
45 | private IAssetProvider m_assetProvider; | 47 | private IAssetProvider m_assetProvider; |
46 | 48 | ||
@@ -52,7 +54,7 @@ namespace OpenSim.Grid.AssetServer | |||
52 | public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) | 54 | public GetAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) |
53 | : base("GET", "/assets") | 55 | : base("GET", "/assets") |
54 | { | 56 | { |
55 | MainLog.Instance.Verbose("REST", "In Get Request"); | 57 | m_log.Info("[REST]: In Get Request"); |
56 | m_assetManager = assetManager; | 58 | m_assetManager = assetManager; |
57 | m_assetProvider = assetProvider; | 59 | m_assetProvider = assetProvider; |
58 | } | 60 | } |
@@ -71,8 +73,8 @@ namespace OpenSim.Grid.AssetServer | |||
71 | 73 | ||
72 | if (!LLUUID.TryParse(p[0], out assetID)) | 74 | if (!LLUUID.TryParse(p[0], out assetID)) |
73 | { | 75 | { |
74 | MainLog.Instance.Verbose( | 76 | m_log.Info(String.Format( |
75 | "REST", "GET:/asset ignoring request with malformed UUID {0}", p[0]); | 77 | "[REST]: GET:/asset ignoring request with malformed UUID {0}", p[0])); |
76 | return result; | 78 | return result; |
77 | } | 79 | } |
78 | 80 | ||
@@ -94,10 +96,9 @@ namespace OpenSim.Grid.AssetServer | |||
94 | 96 | ||
95 | result = ms.GetBuffer(); | 97 | result = ms.GetBuffer(); |
96 | 98 | ||
97 | MainLog.Instance.Verbose( | 99 | m_log.Info(String.Format( |
98 | "REST", | 100 | "[REST]: GET:/asset found {0} with name {1}, size {2} bytes", |
99 | "GET:/asset found {0} with name {1}, size {2} bytes", | 101 | assetID, asset.Name, result.Length)); |
100 | assetID, asset.Name, result.Length); | ||
101 | 102 | ||
102 | Array.Resize<byte>(ref result, (int) ms.Length); | 103 | Array.Resize<byte>(ref result, (int) ms.Length); |
103 | } | 104 | } |
@@ -106,13 +107,13 @@ namespace OpenSim.Grid.AssetServer | |||
106 | if (StatsManager.AssetStats != null) | 107 | if (StatsManager.AssetStats != null) |
107 | StatsManager.AssetStats.AddNotFoundRequest(); | 108 | StatsManager.AssetStats.AddNotFoundRequest(); |
108 | 109 | ||
109 | MainLog.Instance.Verbose("REST", "GET:/asset failed to find {0}", assetID); | 110 | m_log.Info(String.Format("[REST]: GET:/asset failed to find {0}", assetID)); |
110 | } | 111 | } |
111 | } | 112 | } |
112 | } | 113 | } |
113 | catch (Exception e) | 114 | catch (Exception e) |
114 | { | 115 | { |
115 | MainLog.Instance.Error(e.ToString()); | 116 | m_log.Error(e.ToString()); |
116 | } | 117 | } |
117 | return result; | 118 | return result; |
118 | } | 119 | } |
@@ -120,6 +121,8 @@ namespace OpenSim.Grid.AssetServer | |||
120 | 121 | ||
121 | public class PostAssetStreamHandler : BaseStreamHandler | 122 | public class PostAssetStreamHandler : BaseStreamHandler |
122 | { | 123 | { |
124 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
125 | |||
123 | private OpenAsset_Main m_assetManager; | 126 | private OpenAsset_Main m_assetManager; |
124 | private IAssetProvider m_assetProvider; | 127 | private IAssetProvider m_assetProvider; |
125 | 128 | ||
@@ -135,7 +138,7 @@ namespace OpenSim.Grid.AssetServer | |||
135 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); | 138 | XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); |
136 | AssetBase asset = (AssetBase) xs.Deserialize(request); | 139 | AssetBase asset = (AssetBase) xs.Deserialize(request); |
137 | 140 | ||
138 | MainLog.Instance.Verbose("REST", "StoreAndCommitAsset {0}", asset.FullID); | 141 | m_log.Info(String.Format("[REST]: StoreAndCommitAsset {0}", asset.FullID)); |
139 | m_assetProvider.CreateAsset(asset); | 142 | m_assetProvider.CreateAsset(asset); |
140 | m_assetProvider.CommitAssets(); | 143 | m_assetProvider.CommitAssets(); |
141 | 144 | ||