Package org.apdplat.module.log.model

Examples of org.apdplat.module.log.model.OperateLog


        m.setTotalMemory(10000f);
        m.setUsableMemory(8000f);
       
        list.add(m);
       
        OperateLog o = new OperateLog();
        o.setAppName("开发平台");
        o.setLoginIP("192.68.23.12");
        o.setOperatingID(20);
        o.setOperatingModel("用户信息");
        o.setOperatingTime(new Date());
        o.setOperatingType("删除");
        o.setServerIP("192.168.0.1");
        o.setUsername("杨尚川ysc");
       
        list.add(o);
       
        LogHandler h = new SolrLogHandler();
        h.handle(list);
View Full Code Here


    private void saveLog(Model model, String type){
        //判断模型是否已经指定忽略记录增删改日志
        if(!model.getClass().isAnnotationPresent(IgnoreBusinessLog.class)){
            User user=UserHolder.getCurrentLoginUser();
            String ip=UserHolder.getCurrentUserLoginIp();
            OperateLog operateLog=new OperateLog();
            if(user != null){
                operateLog.setUsername(user.getUsername());
            }
            operateLog.setLoginIP(ip);
            try {
                operateLog.setServerIP(InetAddress.getLocalHost().getHostAddress());
            } catch (UnknownHostException ex) {
                LOG.error("无法获取服务器IP", ex);
            }
            operateLog.setAppName(SystemListener.getContextPath());
            operateLog.setOperatingTime(new Date());
            operateLog.setOperatingType(type);
            operateLog.setOperatingModel(model.getMetaData());
            operateLog.setOperatingID(model.getId());
            //将日志加入内存缓冲区
            BufferLogCollector.collect(operateLog);
        }
    }
View Full Code Here

TOP

Related Classes of org.apdplat.module.log.model.OperateLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.