Search This Blog

Sunday, January 20, 2013

Central Logger and Dashboard tool –Web App

I’ve been working the last 2 weeks on a central logging tool, and a web dashboard. The idea is that any component in a system can post a log record to the central logging server.

Log sentences are defined to be 4 parts long… these are message type (msgtype), message part 1 (msg1), message part 2 (msg2), and message part 3 (msg3). Each part is sent as a string. The server runs a concurrent memory queue, each TCP client sends a log… and the server time and task id are added at the time they arrive.

Every so often (eg 5 seconds or 100 new entries) the memory queue is cleared in a transactional update to the central SQL Lite DB. From testing it seems that this easily supports 10 concurrent users posting 10,000 records at the rate of 2000 inserts per second across the internet. Which is fine for what we need.

The second part is the dashboard, which I built using ASPX and a web service. It also uses OpenLayers to connect to a GeoServer instance to display map content. I use Flexigrid  (http://flexigrid.info/) to display the attribute data and allow for sorting and filtering.

I had 3 main issues with taking the running application from the dev environment to operational. These were:

1) the SQL Lite library supports 32bit and 64bit. I’d dev on a 32bit machine but was trying to run it on a 64bit server. I got around this by creating an IIS application pool and setting it to allow 32bit apps, then assigning this to the web app I’m deploying.

2) The service wasn’t available from any remote web browser, it only ran on the local machine (the web server itself). To fix this I had to add some extra lines to the webconfig…

inside of the  <configuration>   <system.web>
add this section

<webServices>
     <protocols>
       <add name="HttpPost" />
       <add name="HttpGet" />
     </protocols>
</webServices>

For more info:  http://support.microsoft.com/kb/819267

3) Everything was running fine on the IIS server…until after a while  the locationservice.svc was reported to be not be available from the browser.. the error the server reported was:

“Could not load file or assembly App_Web...”

So I copied the files across again to the IIS server and it would all be fine for a while again… until an hour or so later packing up again. This turned out to be an issue where the server recompiles the ASPX code every so often. To turn this facility off you need to add the following to the web config… under <system.web>

<compilation debug="false"  batch="false" />

For more on this error and the fix check this link:

http://stackoverflow.com/questions/4051576/could-not-load-app-web-dll-exception-after-asp-net-compile-recycle

No comments: