package com.sky.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author
* @Date 2021/12/17 16:23
* @Description: 验证log4j漏洞
*/
@RestController
@RequestMapping(value = "/log")
public class Log4jTestController {
static Logger logger = LoggerFactory.getLogger(Log4jTestController.class);
/**
* @param content
* @return
* 1.漏洞版本打印;java version = Java version 1.8.0_171
* 2.修复版本打印:java version = ${java:version}
*/
@GetMapping("/log4j")
public String log4j(String content){
logger.info("java version = ${java:version}");
return content;
}
}