Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

hibernate search logging text files -


we gathering lot of logs, going use database or file store these logs , want able search through them using text search. there way efficiently.

so got

exceptionpersistingservice eps = new exceptionpersistingservice();   try{     //some code might trow exception }catch(exception e){    eps.savenewexceptin(getstacktrace(e));    }  public static string getstacktrace(throwable athrowable) {     //add class name , message passed constructor     final stringbuilder result = new stringbuilder("trace: ");     result.append(athrowable.tostring());     final string new_line = "<br>";     result.append(new_line);      //add each element of stack trace     (stacktraceelement element : athrowable.getstacktrace()) {         result.append(element);         result.append(new_line);     }     return result.tostring(); } 

than create lucene implementation (i recommend using hibernate search) index the exception strings stored in database. in save() method can create object persistentexception has id, date, exceptionstring, user, , possibly url details @ exception occurred.

than have parse queries, create fuzzy or other query , enjoy search results. more details have study books hibernate search in action , lucene in action. have pretty examples on how briefly mentioned.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -