Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.jee.api.cassandra.util;
 
public class Log {
	public static final DateFormat YYYYMMDD = new SimpleDateFormat("yyyyMMdd");

Full log command.
	public static void log(Session sString levelUser userString messageResourceUid... resources) {
		UUID uuid = new base.uuid.UUID().toJavaUUID();
		PreparedStatement p = s.prepare("insert into audit_event (yyyymmdd,uuid,level,message,person_uuid,first_name,last_name,ip) values(?,?,?,?,?,?,?,?)");
		if(user == null) {
					uuid,
					level,
					message,
					null,
					null,
					null,
					null));
else {
					uuid,
					level,
					message,
					user.getPersonUuid() != null?user.getPersonUuid():null,
					user.getLastName(),
					user.getIp()));
		}
		p = s.prepare("insert into audit_type (audit_event_uuid, resource_uid, resource_type) values(?,?,?)");
		for(ResourceUid resource : resources) {
			s.execute(p.bind(uuidresource.getUid(), resource.getType()));
		}
	}
	public static void log(Session sString levelString message) {
		UUID uuid = new base.uuid.UUID().toJavaUUID();
		PreparedStatement p = s.prepare("insert into audit_event (yyyymmdd,uuid,level,message) values(?,?,?,?)");
		s.execute(p.bind(.format(new Date()), uuidlevelmessage));
	}
New to GrepCode? Check out our FAQ X