By simpler solution, I mean this 10 line snippet: HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.apache.org"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream responseStream = response.GetResponseStream(); using (StreamReader streamReader = new StreamReader(responseStream)) { while (streamReader.Peek() >= 0) { log.Debug("streamReader.ReadLine(): " + streamReader.ReadLine()); } }
Have you verified that code like that works as expected before trying to implement a more complex pattern? Are you able to walk through your code in a debugger? If so, is the program executed as you expected? If you replace calls to log4net with Console.WriteLine do all messages appear correctly? --- Charles Johnson <[EMAIL PROTECTED]> wrote: > >> > It looks like you're requesting a webpage > then you want to iterate through each line in the file looking for > information. > >> > > That's correct (as the link describes) > > >>There's got to be a simpler solution than the one you came up with > > What's not simple about it? Perhaps you're referring to the use of > the Observer pattern? Admittedly it's slightly misleading in this > case since the fact that everything is presented in the same > compilation unit negates the benefit of loose coupling afforded by > using this pattern, but this is for *testing* purposes only - the > observer would be in a different unit later. > > >>I suspect the problems you're experiencing are coming from > theover-complication of reading a Stream. > > Not sure about this. Am at the moment testing it by eliminating all > logging to see if i can reproduce the effect of varying numbers of > lines being read or returned. > > CJ > > > > Ron Grabowski wrote: > > >What are you trying to do? It looks like you're requesting a webpage > >then you want to iterate through each line in the file looking for > >information. There's got to be a simpler solution than the one you > came > >up with. I suspect the problems you're experiencing are coming from > the > >over-complication of reading a Stream. What exactly is your log4net > >question? > > > >--- Charles Johnson <[EMAIL PROTECTED]> wrote: > > > > > > > >>I'm experiencing a problem that varies each time i run my app. > >>Sometimes > >>it reads all the content, sometimes just the top part. I don't want > >>to > >>prejudge things, but perhaps someone could comment on this question > i > >>posted? > >> > >> > >> > >> > >http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_21454942.html > > > > > >> > >> > > > > > > > > >