Index: library/bdm/base/user_info.h
===================================================================
--- library/bdm/base/user_info.h (revision 710)
+++ library/bdm/base/user_info.h (revision 728)
@@ -441,4 +441,14 @@
 	}
 
+//! The new instance of type T* is constructed and initialized with values stored in the given Setting 
+//!
+//! Handy in mex files. Use with care.
+template<class T>
+static shared_ptr<T> build ( const Setting &element, SettingPresence settingPresence = optional ) {	
+	shared_ptr<T> instance;
+	from_setting<T> ( instance,  element  );
+	return instance;
+}
+
 	//!@}
 
Index: library/bdm/base/bdmbase.h
===================================================================
--- library/bdm/base/bdmbase.h (revision 727)
+++ library/bdm/base/bdmbase.h (revision 728)
@@ -611,22 +611,34 @@
 		};
 		root::log_register(L,prefix);
-		logrec->ids.set_size(3);
-		if (log_level >0){
-			logrec->ids(0) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep()+ "mean" );
-		}
-		if (log_level >1){
-			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" );
+		
+		// log full data
+		if (log_level==10) {
+			logrec->ids.set_size(1);
+			logrec->ids(0) = logrec->L.add_setting(prefix);
+		} else {
+			// log only 
+			logrec->ids.set_size(3);
+			if (log_level >0){
+				logrec->ids(0) = logrec->L.add_vector ( r, prefix + logrec->L.prefix_sep()+ "mean" );
+			}
+			if (log_level >1){
+				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.log_vector( logrec->ids(0), mean() );
-		}
-		if (log_level>1) {
-			vec lb; vec ub;
-			qbounds(lb,ub);
-			logrec->L.log_vector( logrec->ids(1), lb );
-			logrec->L.log_vector( logrec->ids(2), ub );
+		if (log_level==10){
+			to_setting(logrec->L.log_to_setting(logrec->ids(0)));
+		} else {
+			if (log_level>0) {
+				logrec->L.log_vector( logrec->ids(0), mean() );
+			}
+			if (log_level>1) {
+				vec lb; vec ub;
+				qbounds(lb,ub);
+				logrec->L.log_vector( logrec->ids(1), lb );
+				logrec->L.log_vector( logrec->ids(2), ub );
+			}
 		}
 	}
@@ -1207,6 +1219,6 @@
 	//! Set boolean options from a string, recognized are: "logbounds,logll"
 	virtual void set_options ( const string &opt ) {
-		if ( opt.find ( "logstat" ) != string::npos ) {
-			const_cast<epdf&>(posterior()).set_log_level(3) ;
+		if ( opt.find ( "logfull" ) != string::npos ) {
+			const_cast<epdf&>(posterior()).set_log_level(10) ;
 		} else {
 			if ( opt.find ( "logbounds" ) != string::npos ) {
Index: library/bdm/base/loggers.cpp
===================================================================
--- library/bdm/base/loggers.cpp (revision 676)
+++ library/bdm/base/loggers.cpp (revision 728)
@@ -49,6 +49,6 @@
 void memlog::from_setting ( const Setting &set ) {
 	// TODO tady se natvrdo ocekava existence stringu, nejsou zadne defaulty.. je to tak OK?
-	string itfilename = ( const char* ) set["filename"];
-	maxlen = set["maxlen"];
+	UI::get(maxlen,  set,"maxlen",UI::compulsory);
+	UI::get(filename,set,"filename");
 }
 
Index: library/bdm/base/loggers.h
===================================================================
--- library/bdm/base/loggers.h (revision 727)
+++ library/bdm/base/loggers.h (revision 728)
@@ -32,9 +32,9 @@
 	//! Storage
 	Array<mat> vectors;
-	//! name of it file to save results
-	string itfilename;
+	//! name of  file to save results (IT file for vectors and cfg for settings)
+	string filename;
 public:
 	//! convenience constructor
-	memlog ( int maxlen0, string itf = "" ) :logger("_"), maxlen ( maxlen0 ), ind ( 0 ), vectors ( 0 ), itfilename ( itf ) {}
+	memlog ( int maxlen0, string fn = "" ) :logger("_"), maxlen ( maxlen0 ), ind ( 0 ), vectors ( 0 ), filename ( fn ) {}
 
 	//!Default constructor
@@ -66,8 +66,11 @@
 	//!
 	void finalize() {
-		if ( itfilename.length() > 0 ) itsave ( itfilename.c_str() );
-		if (settings.length()>0){
-			setting_conf.writeFile("memlog_setting.cfg");
+		if ( filename.length() > 0 ) {
+			itsave ( (filename+".it").c_str());
+			if (settings.length()>0){
+				setting_conf.writeFile( (filename+".cfg").c_str());
+			}
 		}
+		
 	};
 
@@ -80,6 +83,6 @@
 	logger = {
 		class = "memlog";
-		filename = "file_name.it"; // resulting filename with results in it format
-		maxlen = 100;          // size of memory buffer
+		filename = "file_name"; // resulting filename with vectors in it format and setting in cfg
+		maxlen = 100;           // size of memory buffer
 	}
 	\endcode
Index: library/bdm/base/user_info.cpp
===================================================================
--- library/bdm/base/user_info.cpp (revision 565)
+++ library/bdm/base/user_info.cpp (revision 728)
@@ -198,4 +198,7 @@
 	               : element.add ( name, Setting::TypeList );
 
+				   Setting &tag= set.add ( Setting::TypeString );
+				   tag ="matrix";
+				   
 	Setting &cols = set.add ( Setting::TypeInt );
 	cols = matrix.cols();
@@ -260,15 +263,17 @@
 		Setting &elements = link.result[2 + data_offset];
 
-		assert_type ( cols_setting, Setting::TypeInt );
-		assert_type ( rows_setting, Setting::TypeInt );
-		assert_type ( elements, Setting::TypeArray );
+		// vvv ----- not working in matlab!!
+		//assert_type ( cols_setting, Setting::TypeInt );
+		//assert_type ( rows_setting, Setting::TypeInt );
+		//assert_type ( elements, Setting::TypeArray );
 
 		int cols = cols_setting;
 		int rows = rows_setting;
+		int elems = elements.getLength();
 
 		if ( cols < 0 || rows < 0 )
 			throw UISettingException ( "UIException: the dimensions of a matrix has to be non-negative.", link.result );
 
-		if ( elements.getLength() != cols * rows )
+		if ( elems != cols * rows )
 			throw UISettingException ( "UIException: the count of the matrix elements is incompatible with matrix dimension.", elements );
 
