@@ -629,104 +629,8 @@ As the profiler adds some overhead, you might want to enable it only under
629
629
certain circumstances in the production environment. The ``only-exceptions ``
630
630
settings limits profiling to 500 pages, but what if you want to get
631
631
information when the client IP comes from a specific address, or for a limited
632
- portion of the website? You can use a request matcher:
633
-
634
- .. configuration-block ::
635
-
636
- .. code-block :: yaml
637
-
638
- # enables the profiler only for request coming
639
- # for the 192.168.0.0 network
640
- framework :
641
- profiler :
642
- matcher : { ip: 192.168.0.0/24 }
643
-
644
- # enables the profiler only for the /admin URLs
645
- framework :
646
- profiler :
647
- matcher : { path: "^/admin/" }
648
-
649
- # combine rules
650
- framework :
651
- profiler :
652
- matcher : { ip: 192.168.0.0/24, path: "^/admin/" }
653
-
654
- # use a custom matcher instance defined in
655
- # the "custom_matcher" service
656
- framework :
657
- profiler :
658
- matcher : { service: custom_matcher }
659
-
660
- .. code-block :: xml
661
-
662
- <!--
663
- enables the profiler only for request coming
664
- for the 192.168.0.0 network
665
- -->
666
- <framework : config >
667
- <framework : profiler >
668
- <framework : matcher ip =" 192.168.0.0/24" />
669
- </framework : profiler >
670
- </framework : config >
671
-
672
- <!-- enables the profiler only for the /admin URLs -->
673
- <framework : config >
674
- <framework : profiler >
675
- <framework : matcher path =" ^/admin/" />
676
- </framework : profiler >
677
- </framework : config >
678
-
679
- <!-- combine rules -->
680
- <framework : config >
681
- <framework : profiler >
682
- <framework : matcher ip =" 192.168.0.0/24" path =" ^/admin/" />
683
- </framework : profiler >
684
- </framework : config >
685
-
686
- <!--
687
- use a custom matcher instance defined in
688
- the "custom_matcher" service
689
- -->
690
- <framework : config >
691
- <framework : profiler >
692
- <framework : matcher service =" custom_matcher" />
693
- </framework : profiler >
694
- </framework : config >
695
-
696
- .. code-block :: php
697
-
698
- // enables the profiler only for request coming
699
- // for the 192.168.0.0 network
700
- $container->loadFromExtension('framework', array(
701
- 'profiler' => array(
702
- 'matcher' => array('ip' => '192.168.0.0/24'),
703
- ),
704
- ));
705
-
706
- // enables the profiler only for the /admin URLs
707
- $container->loadFromExtension('framework', array(
708
- 'profiler' => array(
709
- 'matcher' => array('path' => '^/admin/'),
710
- ),
711
- ));
712
-
713
- // combine rules
714
- $container->loadFromExtension('framework', array(
715
- 'profiler' => array(
716
- 'matcher' => array(
717
- 'ip' => '192.168.0.0/24',
718
- 'path' => '^/admin/',
719
- ),
720
- ),
721
- ));
722
-
723
- // use a custom matcher instance defined in
724
- // the "custom_matcher" service
725
- $container->loadFromExtension('framework', array(
726
- 'profiler' => array(
727
- 'matcher' => array('service' => 'custom_matcher'),
728
- ),
729
- ));
632
+ portion of the website? You can use a Profiler Matcher, learn more about that
633
+ in ":doc: `/cookbook/profiler/matchers `".
730
634
731
635
Learn more from the Cookbook
732
636
----------------------------
0 commit comments