Repair warning

This commit is contained in:
Igor I
2025-07-03 17:55:01 +05:00
parent 91a1e86415
commit 6e4c74c426
4 changed files with 18 additions and 11 deletions

View File

@ -84,7 +84,7 @@
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.6</version>
<version>7.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/edu.ucar/netcdfAll -->
<dependency>

View File

@ -2544,7 +2544,7 @@ public class AcceptASDCController implements ServletContextAware {
{
//int pR=0;
String pN="";
int pS=0;
long pS=0;
//int pL=0;
String val;
@ -2552,7 +2552,7 @@ public class AcceptASDCController implements ServletContextAware {
//if(val!=null) pR=Integer.parseInt(val);
pN = reqN;
val = reqS;
if(val!=null) pS=Integer.parseInt(val);
if(val!=null) pS=Long.parseLong(val);
val = reqL;
//if(val!=null) pL=100;
@ -3046,7 +3046,7 @@ public class AcceptASDCController implements ServletContextAware {
data_dir = prop.getProperty("data.dir");
} catch (Exception ex) {
ex.printStackTrace();
logger.error("Error load org_ccalm_main.properties",ex);
logger.error("Error load org_ccalm_main.properties",ex); //TODO delete .properties file and use .yaml file
}
File file = new File(data_dir + "data/" + tableName + "/" + fileName);

View File

@ -110,7 +110,7 @@ public class SendWarning {
return result;
}
//https://ccalm.test/api/locust/v01/SendWarning
//https://ccalm.org/api/locust/v01/SendWarning
@RequestMapping(value = {"/api/locust/v01/SendWarning"},method = RequestMethod.GET,produces = "application/json;charset=UTF-8")
@ResponseBody
public ResponseEntity<Object> send() {
@ -124,7 +124,7 @@ public class SendWarning {
t.user_uid,
t.lat,
t.lon,
'irigm@mail.ru' as email, --u.email,
u.email,
l.short_name,
t.temperature_air,
t.warn_air,
@ -181,7 +181,7 @@ public class SendWarning {
boolean send = false;
try {
EmailUtility.sendEmail(mail_host, mail_port, mail_login, mail_password, email, trt.trt(true,"Soil temperature"), html.toString());
EmailUtility.sendEmail(mail_host, mail_port, mail_login, mail_password, email, trt.trt(true,"Air temperature"), html.toString());
send = true;
} catch (Exception e) {
e.printStackTrace();

View File

@ -8,8 +8,16 @@
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOGS}/${appName}.log</file>
<encoder>
<pattern>{"timestamp":"%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z'}","thread":"[%thread]","level":"%level","logger":"%logger{36}","marker":"%marker","message":"%msg","exception":"%exOneLine"}%n</pattern>
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<!-- Настраиваем поля для JSON -->
<fieldNames>
<timestamp>timestamp</timestamp>
<thread>thread</thread>
<level>level</level>
<logger>logger</logger>
<message>message</message>
<exception>exception</exception>
</fieldNames>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOGS}/${appName}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
@ -25,10 +33,9 @@
</encoder>
</appender>
<!--root level="info"-->
<root level="warn">
<appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>
</configuration>