Index: library/bdm/base/bdmbase.h
===================================================================
--- library/bdm/base/bdmbase.h (revision 723)
+++ library/bdm/base/bdmbase.h (revision 727)
@@ -319,4 +319,8 @@
 		//!separator of prefixes of entries
 		const string separator;
+		//! Root Setting for storing Settings
+		Config setting_conf;
+		//! list of Settings for specific ids
+		Array<Setting*> settings;
 	public:
 		//!Default constructor
@@ -325,5 +329,5 @@
 		//! returns an identifier which will be later needed for calling the \c logit() function
 		//! For empty RV it returns -1, this entry will be ignored by \c logit().
-		virtual int add ( const RV &rv, string prefix = "" ) {
+		virtual int add_vector ( const RV &rv, string prefix = "" ) {
 			int id;
 			if ( rv._dsize() > 0 ) {
@@ -337,9 +341,23 @@
 			return id; // identifier of the last entry
 		}
+		virtual int add_setting(const string &prefix){
+			Setting &root=setting_conf.getRoot();
+			int id=root.getLength(); //root must be group!!
+			if (prefix.length()>0){
+				settings.set_length(id+1,true);
+				settings(id) = &root.add(prefix, Setting::TypeList);
+			} else {id=-1;}
+			return id;
+		}
 		
 		//! log this vector
-		virtual void logit ( int id, const vec &v ) {
+		virtual void log_vector ( int id, const vec &v ) {
 			bdm_error ( "Not implemented" );
 		};
+		
+		virtual Setting & log_to_setting (int id){
+			return settings(id)->add(Setting::TypeGroup);
+		}
+		
 		//! log this double
 		virtual void logit ( int id, const double &d ) {
@@ -595,20 +613,20 @@
 		logrec->ids.set_size(3);
 		if (log_level >0){
-			logrec->ids(0) = logrec->L.add ( r, prefix + logrec->L.prefix_sep()+ "mean" );
+			logrec->ids(0) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep()+ "mean" );
 		}
 		if (log_level >1){
-			logrec->ids(1) = logrec->L.add ( r, prefix + logrec->L.prefix_sep()+ "lb" );
-			logrec->ids(2) = logrec->L.add ( r, prefix + logrec->L.prefix_sep()+ "ub" );
+			logrec->ids(1) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep()+ "lb" );
+			logrec->ids(2) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep()+ "ub" );
 		}
 	}
 	void log_write() const {
 		if (log_level>0) {
-			logrec->L.logit( logrec->ids(0), mean() );
+			logrec->L.log_vector( logrec->ids(0), mean() );
 		}
 		if (log_level>1) {
 			vec lb; vec ub;
 			qbounds(lb,ub);
-			logrec->L.logit( logrec->ids(1), lb );
-			logrec->L.logit( logrec->ids(2), ub );
+			logrec->L.log_vector( logrec->ids(1), lb );
+			logrec->L.log_vector( logrec->ids(2), ub );
 		}
 	}
@@ -1013,6 +1031,6 @@
 		if (log_level >0){
 			logrec->ids.set_size(2);
-			logrec->ids(0) = logrec->L.add ( Yrv, prefix );
-			logrec->ids(1) = logrec->L.add ( Urv, prefix );
+			logrec->ids(0) = logrec->L.add_vector ( Yrv, prefix );
+			logrec->ids(1) = logrec->L.add_vector ( Urv, prefix );
 		}
 	}
@@ -1023,7 +1041,7 @@
 			getdata ( tmp );
 			// d is first in getdata
-			logrec->L.logit ( logrec->ids(0), tmp.left ( Yrv._dsize() ) );
+			logrec->L.log_vector ( logrec->ids(0), tmp.left ( Yrv._dsize() ) );
 			// u follows after d in getdata
-			logrec->L.logit ( logrec->ids(1), tmp.mid ( Yrv._dsize(), Urv._dsize() ) );
+			logrec->L.log_vector ( logrec->ids(1), tmp.mid ( Yrv._dsize(), Urv._dsize() ) );
 		}
 	}
@@ -1189,11 +1207,15 @@
 	//! Set boolean options from a string, recognized are: "logbounds,logll"
 	virtual void set_options ( const string &opt ) {
-		if ( opt.find ( "logbounds" ) != string::npos ) {
-			const_cast<epdf&>(posterior()).set_log_level(2) ;
+		if ( opt.find ( "logstat" ) != string::npos ) {
+			const_cast<epdf&>(posterior()).set_log_level(3) ;
 		} else {
-			const_cast<epdf&>(posterior()).set_log_level(1) ;
-		}
-		if ( opt.find ( "logll" ) != string::npos ) {
-			log_level = 1;
+			if ( opt.find ( "logbounds" ) != string::npos ) {
+				const_cast<epdf&>(posterior()).set_log_level(2) ;
+			} else {
+				const_cast<epdf&>(posterior()).set_log_level(1) ;
+			}
+			if ( opt.find ( "logll" ) != string::npos ) {
+				log_level = 1;
+			}
 		}
 	}
@@ -1210,5 +1232,5 @@
 		if ((log_level) > 0){
 			logrec->ids.set_size(1);
-			logrec->ids(0) = L.add(RV("ll",1), prefix+L.prefix_sep()+"ll");
+			logrec->ids(0) = L.add_vector(RV("",1), prefix+L.prefix_sep()+"ll");
 		}
 	}
Index: library/bdm/base/loggers.h
===================================================================
--- library/bdm/base/loggers.h (revision 685)
+++ library/bdm/base/loggers.h (revision 727)
@@ -49,5 +49,5 @@
 	}
 
-	void logit ( int id, const vec &v ) {
+	void log_vector ( int id, const vec &v ) {
 		bdm_assert ( id < vectors.length(), "Logger was not initialized, run init()." );
 		if ( id >= 0 ) {
@@ -67,4 +67,7 @@
 	void finalize() {
 		if ( itfilename.length() > 0 ) itsave ( itfilename.c_str() );
+		if (settings.length()>0){
+			setting_conf.writeFile("memlog_setting.cfg");
+		}
 	};
 
