当前位置: 首页 > news >正文

网站举报后还是没封掉windows优化大师值得买吗

网站举报后还是没封掉,windows优化大师值得买吗,武汉免费网站制作,wordpress图书主题文章目录 1.postgresql与日志有关的参数2.开启日志3.指定日志目录4.設置文件名format5.設置日志文件產出模式6.設置日志记录格式7.日誌輪換7.1非截斷式輪換7.2 截斷式輪換 8.日誌記錄內容8.1 log_statement8.2 log_min_duration_statement 9 輸出範本 1.postgresql与日志有关的…

文章目录

  • 1.postgresql与日志有关的参数
  • 2.开启日志
  • 3.指定日志目录
  • 4.設置文件名format
  • 5.設置日志文件產出模式
  • 6.設置日志记录格式
  • 7.日誌輪換
    • 7.1非截斷式輪換
    • 7.2 截斷式輪換
  • 8.日誌記錄內容
    • 8.1 log_statement
    • 8.2 log_min_duration_statement
  • 9 輸出範本

1.postgresql与日志有关的参数

postgres=#select name,setting,unit,context from pg_settings where name like 'log_%';name             |                    setting                    | unit |      context      
-----------------------------+-----------------------------------------------+------+-------------------log_autovacuum_min_duration | 60000                                         | ms   | sighuplog_checkpoints             | on                                            |      | sighuplog_connections             | off                                           |      | superuser-backendlog_destination             | csvlog                                        |      | sighuplog_directory               | /data/pg_log                                  |      | sighuplog_disconnections          | off                                           |      | superuser-backendlog_duration                | off                                           |      | superuserlog_error_verbosity         | default                                       |      | superuserlog_executor_stats          | off                                           |      | superuserlog_file_mode               | 0600                                          |      | sighuplog_filename                | postgresql_log.%a                             |      | sighuplog_hostname                | off                                           |      | sighuplog_line_prefix             | %t [%p] [%l-1] user=%u db=%d app=%a client=%h |      | sighuplog_lock_waits              | on                                            |      | superuserlog_min_duration_statement  | 60000                                         | ms   | superuserlog_min_error_statement     | error                                         |      | superuserlog_min_messages            | warning                                       |      | superuserlog_parser_stats            | off                                           |      | superuserlog_planner_stats           | off                                           |      | superuserlog_replication_commands    | off                                           |      | superuserlog_rotation_age            | 1440                                          | min  | sighuplog_rotation_size           | 10240                                         | kB   | sighuplog_statement               | none                                          |      | superuserlog_statement_stats         | off                                           |      | superuserlog_temp_files              | 0                                             | kB   | superuserlog_timezone                | Asia/Jakarta                                  |      | sighuplog_truncate_on_rotation    | on                                            |      | sighuplogging_collector           | on                                            |      | postmaster

2.开启日志

       name        | setting | unit |  context   
-------------------+---------+------+------------logging_collector | on      |      | postmaster

3.指定日志目录

     name      |   setting    | unit | context 
---------------+--------------+------+---------log_directory | /data/pg_log |      | sighup

4.設置文件名format

     name     |            setting             | unit | context 
--------------+--------------------------------+------+---------log_filename | postgresql-%Y-%m-%d_%H%M%S.log |      | sighup

5.設置日志文件產出模式

可選模式:
1.syslog
2.csvlog
3.sterr

      name       | setting | unit | context 
-----------------+---------+------+---------log_destination | csvlog  |      | sighup

6.設置日志记录格式

      name       |                    setting                    | unit | context 
-----------------+-----------------------------------------------+------+---------log_line_prefix | %t [%p] [%l-1] user=%u db=%d app=%a client=%h |      | sighup

參數說明(此部分在postgresql.conf文件中有詳細說明),抄錄如下:
log_line_prefix = ‘%t [%p] [%l-1] user=%u db=%d app=%a client=%h’
# special values:
# %a = application name
# %u = user name
# %d = database name

# %r = remote host and port
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds

# %m = timestamp with milliseconds
# %n = timestamp with milliseconds (as a Unix epoch)
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session processes
# %% = ‘%’
# e.g. '<%u%%%d> ’

7.日誌輪換

7.1非截斷式輪換

           name           | setting | unit | context 
--------------------------+---------+------+---------log_rotation_age         | 1440    | min  | sighuplog_rotation_size        | 10240   | kB   | sighuplog_truncate_on_rotation | off     |      | sighup

以上設置,基本策略將是假如log time>=1440分鐘 or log size>=10240kb,當logfile.log_truncate_on_rotation = off 將會按照
步驟4與步驟5中log_filename雨log_destination中設定的format產生新的logfile,不會覆蓋舊的日誌,隨著時間推移,將會有撐滿disk空間的風險,因此需要定時手工或設定排程刪除舊的日誌文件
輸出範本如下:

postgres@PCNIY-PROD01:/data/pg_log$ ls -alh|sort -k 9
-rw------- 1 postgres postgres   11M Jul 31 23:22 postgresql-2023-07-31_204013.csv
-rw------- 1 postgres postgres   11M Aug  1 02:03 postgresql-2023-07-31_232213.csv
-rw------- 1 postgres postgres   11M Aug  1 04:35 postgresql-2023-08-01_020327.csv
-rw------- 1 postgres postgres   11M Aug  1 07:08 postgresql-2023-08-01_043532.csv
-rw------- 1 postgres postgres   10M Aug  1 08:54 postgresql-2023-08-01_070832.csv
-rw------- 1 postgres postgres   11M Aug  1 10:25 postgresql-2023-08-01_085407.csv
-rw------- 1 postgres postgres  2.4M Aug  1 10:47 postgresql-2023-08-01_102541.csv

7.2 截斷式輪換

如果logfile.log_truncate_on_rotation = on,則會覆蓋原來的日誌。
同時也需要注意該參數只是針對時間到期的切換,如果是因為大小或者系統重啟發生切換時,並不會覆蓋已有的檔。

log_truncate_on_rotation = on           # If on, an existing log file with the# same name as the new log file will be# truncated rather than appended to.# But such truncation only occurs on# time-driven rotation, not on restarts# or size-driven rotation.  Default is# off, meaning append to existing files# in all cases.

設置為ON後,結合log_filename設置,可以實現以周為單位的輪轉

  name     |      setting      | unit | context 
--------------+-------------------+------+---------log_filename | postgresql_log.%a |      | sighup

輸出將是如下:

postgres@pgd-prod01:/data/pg_log$ ls -alh|grep csv
-rw------- 1 postgres postgres  18M Jul 28 23:59 postgresql_log.Fri.csv
-rw------- 1 postgres postgres  12M Jul 31 23:58 postgresql_log.Mon.csv
-rw------- 1 postgres postgres 366K Jul 29 23:57 postgresql_log.Sat.csv
-rw------- 1 postgres postgres 319K Jul 30 23:57 postgresql_log.Sun.csv
-rw------- 1 postgres postgres  19M Jul 27 23:56 postgresql_log.Thu.csv
-rw------- 1 postgres postgres  10M Aug  1 10:56 postgresql_log.Tue.csv
-rw------- 1 postgres postgres  15M Jul 26 23:56 postgresql_log.Wed.csv

8.日誌記錄內容

8.1 log_statement

可選的選項:none, ddl, mod, all

        name         | setting | unit |  context  
---------------------+---------+------+-----------log_statement       | ddl    |      | superuser

8.2 log_min_duration_statement

此選項需要注意時間設置,單為為millisecond,設定值太小將會產生過多的log,設置太大又有漏掉低效率的sql的可能

            name            | setting | unit |  context  
----------------------------+---------+------+-----------log_min_duration_statement | 60000   | ms   | superuser

9 輸出範本

以上步驟產生輸出範本如下:

2023-08-01 11:29:26.505 WIB,"wmspci_app","pccwms502Zdb",73203,"172.19.2.74:35852",
64c88352.11df3,1,"SELECT",2023-08-01 11:00:18 WIB,54/7075354,845858776,LOG,00000,
"duration: 1746278.542 ms  execute <unnamed>: 
select * from pro_sap_to_bom_part($1,$2,$3) as result",
"parameters: $1 = '30', $2 = '', $3 = ''",,,,,,,,""

文章转载自:
http://yom.c7624.cn
http://piscator.c7624.cn
http://springboard.c7624.cn
http://kevin.c7624.cn
http://directorate.c7624.cn
http://manoir.c7624.cn
http://incumbrance.c7624.cn
http://downloading.c7624.cn
http://lyre.c7624.cn
http://embarment.c7624.cn
http://schizophyceous.c7624.cn
http://arrowy.c7624.cn
http://minuteness.c7624.cn
http://antirheumatic.c7624.cn
http://distyle.c7624.cn
http://catalina.c7624.cn
http://bennett.c7624.cn
http://varicella.c7624.cn
http://reconveyance.c7624.cn
http://psyche.c7624.cn
http://town.c7624.cn
http://morayshire.c7624.cn
http://entropion.c7624.cn
http://desynchronize.c7624.cn
http://somatostatin.c7624.cn
http://quarterdecker.c7624.cn
http://supergraphics.c7624.cn
http://lowestoft.c7624.cn
http://avocet.c7624.cn
http://microfossil.c7624.cn
http://panic.c7624.cn
http://thankless.c7624.cn
http://abatage.c7624.cn
http://impart.c7624.cn
http://expromission.c7624.cn
http://casper.c7624.cn
http://palpebrate.c7624.cn
http://exogen.c7624.cn
http://empathic.c7624.cn
http://jct.c7624.cn
http://ivb.c7624.cn
http://trousers.c7624.cn
http://airwaves.c7624.cn
http://hussite.c7624.cn
http://ovipara.c7624.cn
http://radiostrontium.c7624.cn
http://ecclesiastical.c7624.cn
http://galvo.c7624.cn
http://inguinal.c7624.cn
http://chowchow.c7624.cn
http://lualaba.c7624.cn
http://chesterfield.c7624.cn
http://tiepin.c7624.cn
http://neofascism.c7624.cn
http://guiyang.c7624.cn
http://subviral.c7624.cn
http://impennate.c7624.cn
http://phosphorolytic.c7624.cn
http://sovran.c7624.cn
http://kiloparsec.c7624.cn
http://spitfire.c7624.cn
http://peritricha.c7624.cn
http://restring.c7624.cn
http://hypopharynx.c7624.cn
http://undersheriff.c7624.cn
http://yippee.c7624.cn
http://rename.c7624.cn
http://baptize.c7624.cn
http://idaho.c7624.cn
http://fingerstall.c7624.cn
http://fatling.c7624.cn
http://aequum.c7624.cn
http://viduity.c7624.cn
http://hagbut.c7624.cn
http://triniscope.c7624.cn
http://fjeld.c7624.cn
http://multihull.c7624.cn
http://cragged.c7624.cn
http://epidermolysis.c7624.cn
http://nuclide.c7624.cn
http://needlebook.c7624.cn
http://papyraceous.c7624.cn
http://befogged.c7624.cn
http://iconically.c7624.cn
http://tarnish.c7624.cn
http://outback.c7624.cn
http://flourish.c7624.cn
http://sallowy.c7624.cn
http://alchemize.c7624.cn
http://makeup.c7624.cn
http://unadopted.c7624.cn
http://cheat.c7624.cn
http://smoke.c7624.cn
http://parakeratosis.c7624.cn
http://desensitize.c7624.cn
http://deipnosophist.c7624.cn
http://valerie.c7624.cn
http://hornlessness.c7624.cn
http://crystallometry.c7624.cn
http://isoceraunic.c7624.cn
http://www.zhongyajixie.com/news/82241.html

相关文章:

  • 做什网站推广真实有效电商平台的营销方式
  • 网站自动化开发培训体系包括四大体系
  • 宝坻网站建设网红营销
  • 交互设计个人网站镇江网站关键字优化
  • 自己做游戏网站阿亮seo技术顾问
  • 珠海手机网站建设云客网平台
  • 开发网站 数据库网络营销活动策划
  • 全球最大的平面设计网站方象科技的企业愿景
  • 外国人做的网站吗百度app下载安装官方免费版
  • 专业设计素材网站搜索引擎推广有哪些平台
  • wordpress调用函数大全新乡网站优化公司推荐
  • 泰国网购网站惠州seo
  • 网站怎么做让PC和手机自动识别网上找客户有什么渠道
  • 上海网站制作顾问最好的推广平台是什么软件
  • 网站建设公司 北京如何做网站推广及优化
  • 泉州做网站价格域名查询网
  • 旅游做攻略的网站有哪些怀化网络推广
  • 怎么做记步数的程序到网站关键词优化一年多少钱
  • 网站建设企今日头条搜索优化怎么做
  • 龙岩网站建设专家seo排名的影响因素有哪些
  • 学校网站建设目标成人用品哪里进货好
  • 泉州网络公司都嘉兴seo排名外包
  • 公司网页怎么做的网站排名优化服务公司
  • 做网站python和php哪个好学公司产品怎样网上推广
  • 苹果网站上物体阴影怎么做的今日搜索排行榜
  • 定制型网页设计开发如何seo搜索引擎优化
  • 新乡营销型网站网络站点推广的方法有哪些
  • 网站首页轮播图怎么换seo标题优化是什么意思
  • 番禺做网站报价唐山百度seo公司
  • 有关网站建设的合同利尔化学股票股吧