Downloaded StructureMap But Seems To Be Missing The Log4Net.Dll?
Mar 11, 2010
I am currently following instructions in a book to develop an application. It asks me to download StructureMap and then move the StructureMap.Dll file and the Log4Net.dll into the bin files. The problem is there doesnt seem to be a Log4Net.dll file in the StructureMap files, the only other dll apart from the StructureMap.dll is the Rhino.Mock.dll.
I am building a mvc app using structuremap.. I have quite a few places where I use ObjectFactory.GetInstance<InstanceName>(). my app was working fine until I added a couple more functions, now all it does when I start up my app in VWD2010 express is stall and give me a StackOverflowException when I debug. and most of the exceptions are with ObjectFactory.GetInstance<InstanceName> calls.
I just followed this example to bootstrap WCF with StructureMap. At the same time I've been using StructureMap in my ASP.NET application (IIS6), which is initialized in Global.asax.Application_Start().The two configurations have different requirements. Unfortunately, StructureMap is configured statically, and contrary to my expectations it's shared between the web app and WCF. As a result, the last "Initialize()" called wins!
Is it possible to give each one its own configuration? Or is the only solution to fold them together?
Recently, I've had some problems with StructureMap. Mostly incomplete documentation, but also they have a habit of drastically changing namespacing, object names, removing methods, and generally changing how the thing works.For now, my code is written using poor man's DI so that I can keep working on it, but I don't want to leave it that way. I took a look at Castle Windsor a while back, but never really tackled it.
With StructureMap, I would derive a custom Registry class where all the mapping is done, a custom Bootstrap class which loads one or more registry classes and initializes them, and then, call Configure on the bootstrap class in Global.asax.How does one go about setting up the matching Castle code? I also need to know how the controller factory is affected. Does Castle provide a replacement, or are we left to write our own, as with StructureMap
i've been using structuremap since a couple of months. I always use ObjectFactory.GetInstance to take the right instance of the object i've to use.Actually, i need to understand which is the default ObjectFactory's InstanceScope. Is it ThreadLocal? do u know where i can read about it?
I am using the above combo in a new web app Im doing just to try to learn to build new stuff to expand my knowledge. Im hoping to go live if I do a good job.. Im kind of new at MVC and the other products so I was trying to find a link to a good tutorial that set all of these up together.
Am trying out structuremap for the first time and am getting the following compiler error,
StructureMap Exception Code: 202
No Default Instance defined for PluginFamily Super.SuperCore.Core.DataAccess.IPersonRepository, Super.SuperCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
we are currently implementing logging functionality with Log4net into our ASP.NET web-services. Therefore we have installed Log4net into the GAC (global assembly cache) on every machine. On our Windows 2003 servers this works just fine.Funny thing is, when developing on our local clients, logging with Log4net doesn't work unless we copy the log4net.dll into the Bin folder of the ASP.NET website even though it is already installed in the GAC. This behaviour is for my colleague's machine and me and we just can't find the reason why. The application is identically like on the server and we installed Log4net the same way into the GAC but it behaves differently.We've tested it with the VS2008 integrated web-server as well as with IIS (WinXP).
We have an application that logs using log4net. But we would like to delete the logfiles every 4 weeks (automatically). Is there an option in log4net to do this or do we need to have a work arround?
The code seems ok, except for events that have no user context associated with them (ie. a user on our public web page). In that case the log4net capture seems to sometime write the last logged in user account (bad) and sometime write a null (good). Anyone got this feature to work reliably in all cases? I believe I saw a note that MDC is no longer a recommended feature to use, but I wasn't able to find any alternatives that are recommended.
Note: I find it odd that MDC is set with an account name, but never cleared if no user is active. That could be part of the problem. However, I didn't find any MDC code extracts that also clear the username.
I'm using log4net to log my web app's progress, using Log4PostSharp to AOP-injectify all methods. This has the desired effect of logging (almost) everything and is fine.I now have a requirement to log JUST Page_Load methods to a file / console. I can obviously hamstring the log4postsharp class to do that, but then I'd be losing all the other logging.I've been looking at filters in log4net, starting with the StringMatch filter, but that only looks at the message being logged, and I'm after the method name. This put me onto the PropertyFilter, but still with no joy. My log4net.config snippet is thus:
I have tons of requests in log4net that show up manually as ": activity". The requests are all manually built and somewhat clumsy. Is there any way for Log4Net to pick up the source function and record that automatically?
I'm trying to get log4net working in a 'classic' webforms app, using a log4net XML configuration file that I know is correct, as it is a copy of a file I use successfully with a number of other applications. I have the config.log4net file in the main site folder (C:inetpubwwwroot), and I configure log4net in Global.asax.cs as follows:
protected void Application_Start(Object sender, EventArgs e) { var log = LogManager.GetLogger("SomeWebsite"); XmlConfigurator.Configure(new FileInfo("config.log4net")); // bind log to the DI container ... }
Whenever I then use the log instance (even within Application_Start) nothing happens, not even an error. I know that if config.log4net is misconfigured, log4net will silently fail, but I am sure that this isn't the problem. I have a feeling it has to do with FileInfo's base path being wrong.
Now we are worried that since the site is public what could happen to the Jira server if we get alot of issues in the production environment.
We have already filtered on Critical and Fatal, but we want to see either some acumulator service on log4net or a plain filter which identifies repeating issues and prevents them from being sent via Email. Preferably without having to change the error reporting code, so a config solution would be best.
Is is possible to configure FileAppender in log4net to add new entries at the beginning of log file? Currently it is adding entries at the end and reading newest entries requires scrolling whole log down. It would be more comfortable to read from the beginning.
Are there any patterns or practices for monitoring log4net exception logs across a cluster of web servers. I have considered several options including the following:
A central database A log file retrieval system A service based loggin architecture
Does anyone know if it is possible to measure when a file has been downloaded?
I place files for clients to download but there are two things I need to know. One is if the file has been downloaded at all at any point. Second is how many times the file has been downloaded. Can each file (usually but not always image files - sometimes pdfs) be tagged in some way to record what happens to it?