正文
一:如何在win系统设置 任务管理:请百度查询 win系统设置 任务管理
二:设置 webogic 重启并删除垃圾文件的bat脚本
sqlplus /nolog @C:UsersAdministratorDesktopdrop_trigger.sql SETLOCAL set stop_DOMAIN_HOME=E:Weblogic_dimiansdomainsase_domainin call "%stop_DOMAIN_HOME%stopWebLogic.cmd" %* ENDLOCAL @rmdir /s/q E:Weblogic_dimiansdomainsase_domainserversAdminServerlogs 目录下的所有日志文件信息 del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogs2*.* /s /q del E:Weblogic_dimiansdomainsase_domainserversAdminServercache*.* /s /q del E:Weblogic_dimiansdomainsase_domainserversAdminServerdata*.* /s /q del E:Weblogic_dimiansdomainsase_domainserversAdminServer mp*.* /s /q del C:UsersAdministratorAppDataLocalTempdatamodel*.* /s /q copy C:UsersAdministratorDesktoplog4j.properties E:Weblogic_dimiansdomainsase_domainwarythWEB-INFclasseslog4j.properties copy C:UsersAdministratorDesktoplicences_libpwp-core-2.0.1.20161101.20.jar E:Weblogic_dimiansdomainsase_domainwarythWEB-INFlibpwp-core-2.0.1.20161101.20.jar copy C:UsersAdministratorDesktoplicences_libpwp-framework-3.1.0.20171114.11.release.jar E:Weblogic_dimiansdomainsase_domainwarythWEB-INFlibpwp-framework-3.1.0.20171114.11.release.jar copy C:UsersAdministratorDesktoplicences_libgdsd-czjd-0.0.1-SNAPSHOT.jar E:Weblogic_dimiansdomainsase_domainwarythWEB-INFlibgdsd-czjd-0.0.1-SNAPSHOT.jar SETLOCAL set DOMAIN_HOME=E:Weblogic_dimiansdomainsase_domain call "%DOMAIN_HOME%instartWebLogic.cmd" %* ENDLOCALdrop_trigger.sql
log4j配置
################ levl:DEBUG < INFO< WARN< ERROR<FATAL ; OFF/ ALL log4j.rootLogger = CONSOLE ,logFile ,INFO , ERROR ,FATAL , WARN dir = servers/AdminServer/logs/pwp-log # the dir of the tomcat input log # dir = ${catalina.home} # Set hibernate's log level to Info begin log4j.logger.org.hibernate=WARN # log4j.logger.net.sf.hibernate=INFO log4j.logger.net.sf=WARN # Set hibernate's log level to Info end log4j.logger.org.jbpm=WARN log4j.logger.org.quartz=WARN log4j.logger.org.hibernate.SQL=INFO log4j.logger.org.apache.commons.beanutils.ConvertUtils=INFO log4j.additivity.org.apache.commons.beanutils.ConvertUtils=false log4j.logger.org.apache.commons.beanutils.BeanUtils=INFO log4j.additivity.org.apache.commons.beanutils.BeanUtils=false log4j.logger.org.apache = WARN #log4j.logger.org.apache.tomcat.util = INFO #log4j.logger.org.apache.commons = INFO #log4j.logger.org.apache.catalina = INFO #log4j.additivity.org.apache.tomcat.util = false #log4j.additivity.org.apache.commons = false log4j.logger.org.springframework=WARN # #CONSOLE #org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE = org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.Threshold = DEBUG log4j.appender.console.ImmediateFlush=true #System.out log4j.appender.CONSOLE.Target = System.err log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %c - %m%n # # u65E5u5FD7u6587u4EF6(logFile) log4j.appender.logFile=org.apache.log4j.DailyRollingFileAppender log4j.appender.logFile.Threshold=DEBUG log4j.appender.logFile.ImmediateFlush=true log4j.appender.logFile.Append=true log4j.appender.logFile.File= ${dir}/logFile.log log4j.appender.logFile.DatePattern ='.'yyyy-MM-dd-HH-mm'.log' log4j.appender.logFile.layout=org.apache.log4j.PatternLayout log4j.appender.logFile.layout.ConversionPattern=[%-5p] %d(%r) --> [%t] %l: %m %x %n # #INFO log4j.logger.com.alexgaoyh.util.INFO=INFO log4j.appender.INFO = org.apache.log4j.DailyRollingFileAppender log4j.appender.INFO.layout = org.apache.log4j.PatternLayout log4j.appender.INFO.layout.ConversionPattern = "%p %d{yyyy-MM-dd HH:mm:ss} %-50.50c(%L) - %m%n log4j.appender.INFO.File = ${dir}/INFO.log log4j.appender.INFO.DatePattern ='.'yyyy-MM-dd-HH'.log' log4j.appender.INFO.Append = true log4j.appender.INFO.Threshold = INFO # #ERROR log4j.appender.ERROR = org.apache.log4j.DailyRollingFileAppender log4j.appender.ERROR.Threshold = ERROR log4j.appender.ERROR.File = ${dir}/ERROR.log log4j.appender.ERROR.DatePattern ='.'yyyy-MM-dd-HH'.log' log4j.appender.ERROR.Append = true log4j.appender.ERROR.layout = org.apache.log4j.PatternLayout log4j.appender.ERROR.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %5p %c:%t - %m%n # #FATAL log4j.appender.FATAL = org.apache.log4j.DailyRollingFileAppender log4j.appender.FATAL.File = ${dir}/FATAL.log log4j.appender.FATAL.DatePattern ='.'yyyy-MM-dd-HH'.log' log4j.appender.FATAL.Append = true log4j.appender.FATAL.Threshold = FATAL log4j.appender.FATAL.layout = org.apache.log4j.PatternLayout log4j.appender.FATAL.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %5p %c:%t - %m%n # #WARN log4j.appender.WARN = org.apache.log4j.DailyRollingFileAppender log4j.appender.WARN.File = ${dir}/WARN.log log4j.appender.WARN.DatePattern ='.'yyyy-MM-dd-HH'.log' log4j.appender.WARN.Append = true log4j.appender.WARN.Threshold = WARN log4j.appender.WARN.layout = org.apache.log4j.PatternLayout log4j.appender.WARN.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %5p %c:%t - %m%n #delete_log.bat
del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-loglogFile.log.*.* /s /q del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logERROR.log.*.* /s /q del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logFATAL.log.*.* /s /q del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logINFO.log.*.* /s /q del E:Weblogic_dimiansdomainsase_domainserversAdminServerlogspwp-logWARN.log.*.* /s /q
三:监测cpu是否100%,一旦100% 则重启weblogic 的bat
@echo off for /f "tokens=2 delims==" %%a in ('wmic path Win32_PerfFormattedData_PerfOS_Processor get PercentProcessorTime /value^|findstr "PercentProcessorTime"') do ( set UseCPU=%%a ) echo 111 CPU使用率:%UseCPU%%% SETLOCAL set stop_DOMAIN_HOME=C:UsersAdministratorDesktop if %UseCPU% ==100 call "%stop_DOMAIN_HOME% eload_yth_7001.bat" %* ENDLOCAL if %UseCPU% !=100 exit;