Quartz.Net 配置模板范例

?

?

1.App.config

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <configuration>
  3. ??<configSections>
  4. ????<section
    name="log4net"
    type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"
    />
  5. ????<sectionGroup
    name="common">
  6. ??????<section
    name="logging"
    type="Common.Logging.ConfigurationSectionHandler, Common.Logging"
    />
  7. ????</sectionGroup>
  8. ??</configSections>
  9. ??<common>
  10. ????<logging>
  11. ??????<factoryAdapter
    type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net1211">
  12. ????????<arg
    key="configType"
    value="INLINE"
    />
  13. ??????</factoryAdapter>
  14. ????</logging>
  15. ??</common>
  16. ??<log4net>
  17. ????<appender
    name="ConsoleAppender"
    type="log4net.Appender.ConsoleAppender">
  18. ??????<layout
    type="log4net.Layout.PatternLayout">
  19. ????????<conversionPattern
    value="%d [%t] %-5p %l - %m%n %property{ServiceType}"
    />
  20. ??????</layout>
  21. ????</appender>
  22. ????<appender
    name="EventLogAppender"
    type="log4net.Appender.EventLogAppender">
  23. ??????<layout
    type="log4net.Layout.PatternLayout">
  24. ????????<conversionPattern
    value="%d [%t] %-5p %l - %m%n"
    />
  25. ??????</layout>
  26. ????</appender>
  27. ????<appender
    name="RollingFileAppenderAll"
    type="log4net.Appender.RollingFileAppender">
  28. ??????<param
    name="File"
    value="Log/alllLog.txt"
    />
  29. ??????<appendToFile
    value="true"
    />
  30. ?
  31. ??????<!--Make the rolling file name with the date and size-->
  32. ??????<rollingStyle
    value="Composite"
    />
  33. ??????<datePattern
    value="yyyyMM"
    />
  34. ??????<maxSizeRollBackups
    value="100"
    />
  35. ??????<maximumFileSize
    value="2MB"
    />
  36. ?
  37. ??????<PreserveLogFileNameExtension
    value="true"
    />
  38. ??????<staticLogFileName
    value="false"
    />
  39. ??????<layout
    type="log4net.Layout.PatternLayout">
  40. ????????<param
    name="ConversionPattern"
    value="%d %-5p %m%n"
    />
  41. ??????</layout>
  42. ????</appender>
  43. ????<root>
  44. ??????<level
    value="INFO"
    />
  45. ??????<appender-ref
    ref="ConsoleAppender"
    />
  46. ??????<appender-ref
    ref="RollingFileAppenderAll"
    />
  47. ????</root>
  48. ??</log4net>
  49. ??<appSettings>
  50. ????<add
    key="aspnet:UseTaskFriendlySynchronizationContext"
    value="true"
    />
  51. ??</appSettings>
  52. ??<system.web>
  53. ????<compilation
    debug="true"
    />
  54. ??</system.web>
  55. ??<!-- 部署服务库项目时,必须将配置文件的内容添加到
  56. ??主机的 app.config 文件中。System.Configuration 不支持库的配置文件。-->
  57. ??<runtime>
  58. ????<assemblyBinding
    xmlns="urn:schemas-microsoft-com:asm.v1">
  59. ??????<dependentAssembly>
  60. ????????<assemblyIdentity
    name="Common.Logging.Core"
    publicKeyToken="af08829b84f0328e"
    culture="neutral"
    />
  61. ????????<bindingRedirect
    oldVersion="0.0.0.0-3.1.0.0"
    newVersion="3.1.0.0"
    />
  62. ??????</dependentAssembly>
  63. ??????<dependentAssembly>
  64. ????????<assemblyIdentity
    name="Common.Logging"
    publicKeyToken="af08829b84f0328e"
    culture="neutral"
    />
  65. ????????<bindingRedirect
    oldVersion="0.0.0.0-3.1.0.0"
    newVersion="3.1.0.0"
    />
  66. ??????</dependentAssembly>
  67. ????</assemblyBinding>
  68. ??</runtime>
  69. <startup><supportedRuntime
    version="v4.0"
    sku=".NETFramework,Version=v4.5"
    /></startup></configuration>

?

2.quartz_jobs.xml

?

  1. <job-scheduling-data
    xmlns="http://quartznet.sourceforge.net/JobSchedulingData"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    version="2.0">
  2. ??<processing-directives>
  3. ????<overwrite-existing-data>true</overwrite-existing-data>
  4. ??</processing-directives>
  5. ??<schedule>
  6. ?
  7. ????<!--清除日志文件-->
  8. ????<job>
  9. ??????<name>RemoveLogFileEveryDay</name>
  10. ??????<group>InnerBusiness</group>
  11. ??????<description>每天清除两周以前的日志文件</description>
  12. ??????<job-type>NS.RemoveLogFileEveryDay, NS</job-type>
  13. ??????<durable>false</durable>
  14. ??????<recover>true</recover>
  15. ????</job>
  16. ????<trigger>
  17. ??????<cron>
  18. ????????<name>RemoveLogFileEveryDayTrigger</name>
  19. ????????<group>RemoveLogFileEveryDayTrigger</group>
  20. ????????<description>每天23:00点执行一次</description>
  21. ????????<job-name>RemoveLogFileEveryDay</job-name>
  22. ????????<job-group>InnerBusiness</job-group>
  23. ????????<misfire-instruction>DoNothing</misfire-instruction>
  24. ????????<cron-expression>0 0 23 * * ?</cron-expression>
  25. ??????</cron>
  26. ????</trigger>
  27. ?
  28. ??</schedule>
  29. </job-scheduling-data>

?

?

3.quartz.config

  1. #============================================================================
  2. # Configure Main Scheduler Properties
  3. #============================================================================
  4. org.quartz.scheduler.instanceName = TestScheduler
  5. org.quartz.scheduler.instanceId = AUTO
  6. ?
  7. #============================================================================
  8. # Configure ThreadPool
  9. #============================================================================
  10. org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
  11. org.quartz.threadPool.threadCount = 20
  12. org.quartz.threadPool.threadPriority = 5
  13. ?
  14. #============================================================================
  15. # Configure JobStore
  16. #============================================================================
  17. org.quartz.jobStore.misfireThreshold = 60000
  18. org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
  19. ?
  20. #--------------------------------*************plugin配置------------------------------------
  21. # job initialization plugin handles our xml reading, without it defaults are used
  22. quartz.plugin.xml.type = Quartz.Plugin.Xml.XMLSchedulingDataProcessorPlugin, Quartz
  23. quartz.plugin.xml.fileNames = ~/quartz_jobs.xml
  24. ?
  25. # export this server to remoting context
  26. quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
  27. quartz.scheduler.exporter.port = 2015
  28. quartz.scheduler.exporter.bindName = QuartzScheduler
  29. quartz.scheduler.exporter.channelType = tcp
  30. quartz.scheduler.exporter.channelName = httpQuartz

?

?

参考: http://www.cnblogs.com/philzhou/archive/2012/11/16/2772533.html

时间: 2024-11-03 02:28:28

Quartz.Net 配置模板范例的相关文章

Grafana-zabbix配置模板

官方文档:  http://docs.grafana.org/reference/templating/ Grafana展示Zabbix主机监控图形时,一个一个主机添加过于麻烦.想要查看多台主机的监控图形,通过使用配置模板,调用多台主机数据展示!! 1.配置变量 其中query的匹配原则 * returns all groups *.* returns all hosts (from all groups) Servers.* returns all hosts in group Servers

Nginx基础入门之相关配置模板样例参考

关于nginx,在不同的环境下有不同的配置,比如nginx在LNMP环境中有lamp 环境的配置,从到反向代理时,有反向代理的配置,在做负载均衡时,有负载均衡的配置,下面我们来介绍一下关于nginx不同应用环境的配置样例 通常在配置nginx时,我习惯将nginx配置分为nginx分为两大部分:1.共用nginx配置:2.include引用的web配置,如下所示 * 共用nginx配置模板参考 #user  nobody; user nginx ;   worker_processes  aut

Quartz动态配置表达的方法

在项目中有一个需求,需要灵活配置调度任务时间,并能自由启动或停止调度.有关调度的实现我就第一就想到了Quartz这个开源调度组件,因为很多项目使用过,Spring结合Quartz静态配置调度任务时间,非常easy.比如:每天凌晨几点定时运行一个程序,这只要在工程中的spring配置文件中配置好spring整合quartz的几个属性就好. Spring配置文件 Xml代码?? <bean?id="jobDetail"?class="org.springframework.

完整的的KeepAlived配置模板

参考: http://my.oschina.net/9981/blog/473209 http://my.oschina.net/ahanflw/blog/286206 下面是KeepAlived的配置模板,以后直接用就行了. ! Configuration File for keepalived vrrp_script chk_haproxy {          script "/etc/keepalived/check_haproxy.sh"    //这里是具体的执行的脚本,包

Quartzs -- Quartz.properties 配置

Quartzs -- Quartz.properties 配置 文件加载位置 默认:优先顺序 Classpath:quartz.properties --> org/quartz/quartz.properties (quartz lib) 改变默认:设置一个系统属性"org.quartz.properties"指向对应的properties文件 程序中显示指定 在StdSchedulerFactory.getScheduler()之前使用StdSchedulerFactory.

JBOSS 中oracle-ds.xml的配置模板

http://blog.csdn.net/bo_hai/article/details/6076979 JBOSS 中oracle-ds.xml的配置模板. 代码模版: <?xml version="1.0" encoding="UTF-8"?> <!-- ===================================================================== --> <!--             

quartz spring配置实例代码demo下载

原文:quartz spring配置实例代码demo下载 源代码下载地址:http://www.zuidaima.com/share/1550463459560448.htm

H3C设备与中兴89系列交换机snmp V3配置模板与kali snmpwalk配套测试

SNMP V3 支持三重安全机制,比V2C.V2与V1更安全NMS与Agent建立连接时需要认证,报文传输需要加密:交互时需要团体名. 1.中兴89系列交换机SNMP v3 配置模板:snmp  enable  inform snmp version v3 enable snmp community XXXsnmp-server group ztegrp v3 auth read DefaultViewsnmp-server group ztegrp v3 auth write DefaultV

SPring中quartz的配置(可以用实现邮件定时发送,任务定时执行,网站定时更新等)

http://www.cnblogs.com/kay/archive/2007/11/02/947372.html 邮件或任务多次发送或执行的问题: 1.<property name="concurrent" value="false" />可以用于防止任务多次执行 2.将quartz的配置单独出来,防止tomcat加载spring. 具体做法:http://blog.csdn.net/zhujianpengzha/article/details/814