springboot section add logging

1, a new project springboot

 

 2. Define the facets class, and specify the starting point to obtain the required record information (such as: access to people IP, access address, access address names, etc.)

 

 

 

 3. New Database

SET FOREIGN_KEY_CHECKS=0;

- ----------------------------
- the Table Structure for ds_access_log
- ------------ ----------------
the DROP TABLE `ds_access_log` the IF EXISTS;
the CREATE TABLE ds_access_log`` (
`id` int (. 11) the AUTO_INCREMENT the COMMENT the NOT NULL 'ID',
` url_name` VARCHAR ( 30) DEFAULT NULL COMMENT 'interface name',
`url` VARCHAR (255) the COMMENT the DEFAULT NULL 'interface address',
` ip` VARCHAR (30) DEFAULT NULL COMMENT 'people access the IP',
`user_name` VARCHAR (10) the DEFAULT NULL COMMENT 'access to the user's name',
`add_date` datetime the DEFAULT NULL COMMENT 'access time',
` status` tinyint (2) the DEFAULT '1' COMMENT '0 success 1 failure',
a PRIMARY KEY ( `id`)
) = ENGINE the AUTO_INCREMENT the InnoDB = 7833 DEFAULT CHARSET = utf8 COMMENT = ' system access log';

4. New entity class in the project, MAPPER and other CRUD methods (here I am lazy, do not stick out, these are the most basic)

5. When the user accesses the relevant record each interface will operate

 

 Roughly That's it! Anyway function was achieved

Guess you like

Origin www.cnblogs.com/xiaokangk/p/11445755.html