Permalink
Browse files

Add readme and licence

  • Loading branch information...
1 parent 7846887 commit 06d608b6f46c9093163cf39c285cd5b30d368e33 @seif committed Feb 26, 2012
Showing with 76 additions and 0 deletions.
  1. +47 −0 README.markdown
  2. +29 −0 licence.txt
View
@@ -0,0 +1,47 @@
+##NHibernate.ZMQLogPublisher##
+
+Project started as part of an effort to provide an open source NHibernate profiler. This library will provide the log details to be analyzed by a client application to view the data.
+
+##Limitations##
+ZMQLogger is in its very early stages and there are some limitations which I haven't gotten around sorting out yet.
+
+* The solution is only built with x86 support at the moment, if you want x64 support, you would need to change the target platform for the project and replace the clrzmq package with clrzmq-x64.
+* Uses IInternalLogger interface which introduced in NH3, depending on how things go, I might add an implementaion for log4net so that it would work with previous version of NH.
+* Built against NH3.2. Besides the above limitation, the code is built against NH3.2 so you might get runtime exceptions if you are using a different version of NHibernate, but I doubt that IInternalLogger interface will change often, so a binding redirect should do the trick.
+
+##Usage##
+
+1. Add dependencies to your solution, easiest way is via nuget console:
+
+ install-package clrzmq
+ install-package servicestack.text
+
+2. Downlaod NHibernate.ZMQLogPublisher.dll and add it as a reference in your project.
+
+3. At the start of you application add a call to
+
+ NHibernate.ZMQLogPublisher.Publisher.Start();
+
+ > By default port 68748 is used, if you want to change this, pass a port number to the Start method call.
+
+4. Create a project a subscriber project, add dependencies to it, and start listening for messages:
+
+ using(Context context = new Context(1))
+ using (Socket subscriber = context.Socket(SocketType.SUB))
+ {
+ subscriber.Connect("tcp://localhost:68748");
+ subscriber.Subscribe("", Encoding.Unicode);
+
+ while (!message.Contains("unbinding factory"))
+ {
+ message = subscriber.Recv(Encoding.Unicode);
+
+ Console.WriteLine(message);
+ }
+ }
+
+If you just want to see it working, start the test publisher and test subscriber projects in the source code.
+
+##Licence##
+
+Code is released under the [new bsd licence](licence.txt)
View
@@ -0,0 +1,29 @@
+New BSD License for NHibernate.ZMQLogger
+
+Copyright (c) 2012, Seif Attar
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of Codai, Inc., nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit 06d608b

Please sign in to comment.