Unable to configure logging with 2.12.0.0 version of Enyim.Caching
I have installed 1.8.1 version of the server and tried to enable NLogAdapter for logging needs. It fails because the public key token of Enyim.Caching is not the same as that of Enyim.Caching.NLogAdapter assembly which is cec98615db04012e . So I try to skip verification for the token as sn -Vr *,cec98615db04012e as suggested in some of the forums. This did not help.
I then found this forum entry
http://www.couchbase.com/forums/thread/net-client-where-can-i-find-enyim...
and downloaded the client libraries from http://packages.couchbase.com/clients/net/1.1/Couchbase-Net-Client-1.1.zip
I was then able to enable logging but this version of the libraries fails to communicate with the server :(
I get
2012-10-17 11:30:15.6398|WARN|Couchbase.MessageStreamListener|Could not resolve url http://localhost:8091/pools; trying the next in the list
2012-10-17 11:30:15.6398|WARN|Couchbase.MessageStreamListener|Could not found a working node.
2012-10-17 11:30:15.6398|WARN|Couchbase.MessageStreamListener|All nodes are dead, sleeping for a while.
Where can I find a working set of libraries which can do logging as well as neatly do cache operations?
Thanks in advance.
Please try the latest version of the 1.1 branch:
http://packages.couchbase.com/clients/net/1.1/Couchbase-Net-Client-1.1.6...
If you are still having problems, please post the exact app config and code used to create and set up the client object.
Regards,
Tim
Hi
Thats the same version I am using. If I manually set the logging in code using:
LogManager.AssignFactory(new Log4NetFactory());
I get the following build errors:
The type 'Enyim.Caching.ILogFactory' is defined in an assembly that is not referenced. You must add a reference to assembly 'Enyim.Caching, Version=2.12.0.0, Culture=neutral, PublicKeyToken=cec98615db04012e'.
The best overloaded method match for 'Enyim.Caching.LogManager.AssignFactory(Enyim.Caching.ILogFactory)' has some invalid arguments
Argument 1: cannot convert from 'Enyim.Caching.Log4NetFactory' to 'Enyim.Caching.ILogFactory'
Have followed all instructions, and am using the nuget package for EnyimMemcached-log4net. there seems to be some sort of mismatch between the version of Enyim.Caching in 1.1.6 and the EnyimMemcached-log4net currently available from nuget.
Thanks
Mike
Mike,
I'll try to get more info on what's underlying this. The adapter can be built from source as well, from:
https://github.com/enyim/EnyimMemcached/tree/master/Enyim.Caching.Log4Ne...
Regards,
Tim
Ok, I was finally able to compile a logging adapter that will do the logging and which is also compatible with a working version of Enyim.Caching binary that is successful in doing data cache operations. Followed the below steps
1.
Took the raw code from the link that Tim pointed above - take Enyim.Caching.Log4NetAdapter.csproj , Log4NetFactory.cs , Log4NetWrapper.cs and AssemblyInfo.cs. Compile this raw code in to a dll named Enyim.Caching.Log4NetAdapter.dll
2. Make sure you download the correct version of log4net.dll from the apache download center and reference it in the above project - http://logging.apache.org/log4net/download_log4net.cgi. The version I downloaded is 1.2.11.0
3. Now refernce the Enyim.Caching.dll, Enyim.Caching.Log4NetAdapter.dll and log4net.dll from the debug/release folder of the above project you created in your cache client project.
4. Although it should not matter, make sure the target architecture of the two projects you are working with match.
5. Dont forget to call log4net.Config.XmlConfigurator.Configure() in your client code. You will hit stackoverflowexception otherwise
5. Enable logging in your app.config or web.config as per this link http://www.couchbase.com/develop/net/current
If you follow these steps, things should stick together and you should be able to do logging and do data operations as well.
Tim, it would be great if you can get a working version of these binaries somewhere which others can readily download and avoid this hardship.
Thanks.
-umesh
One additional note, the Enyim.Caching.Log4NetAdapter.csproj that you download might fail to compile because of missing .targets. Instead of using this ready project, create an empty dll project and add Log4NetFactory.cs , Log4NetWrapper.cs and AssemblyInfo.cs and compile in to a dll.
Umesh, thank you for sharing the results of your hard work. I'll ensure that your experience gets back to the developers as well, and we'll work to ensure that this is streamlined as much as possible for the future.
Regards,
Tim
Same here, tried all of the above with no success. Any help would be great as I am having difficulty in tracking down an error when storing data in a memcache bucket. Thanks