j1-template 2021.0.16 → 2021.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/blocks/footer/boxes/legal_statements.proc +4 -0
- data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +1 -1
- data/_includes/themes/j1/modules/connectors/ads +1 -1
- data/_includes/themes/j1/modules/connectors/analytic/google-analytics-legacy.html +36 -0
- data/_includes/themes/j1/modules/connectors/analytic/google-analytics.html +1 -1
- data/_includes/themes/j1/modules/connectors/analytics +2 -3
- data/_includes/themes/j1/modules/connectors/comment/disqus.html +1 -1
- data/_layouts/default.html +11 -1
- data/assets/data/galleries.json +2 -2
- data/assets/data/gallery_customizer.html +2 -2
- data/assets/themes/j1/adapter/js/asciidoctor.js +166 -0
- data/assets/themes/j1/adapter/js/carousel.js +24 -0
- data/assets/themes/j1/adapter/js/fam.js +0 -12
- data/assets/themes/j1/adapter/js/j1.js +36 -21
- data/assets/themes/j1/adapter/js/{jf_gallery.js → justifiedGallery.js} +9 -9
- data/assets/themes/j1/adapter/js/{gallery_customizer.js → justifiedGalleryCustomizer.js} +11 -11
- data/assets/themes/j1/adapter/js/logger.js +35 -23
- data/assets/themes/j1/adapter/js/navigator.js +0 -12
- data/assets/themes/j1/core/css/vendor.css +14 -2
- data/assets/themes/j1/core/css/vendor.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +8 -2
- data/assets/themes/j1/core/js/template.js.map +1 -1
- data/assets/themes/j1/core/js/template.min.js +8 -2
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/log4javascript/docs/backwardsincompatibilities.html +90 -0
- data/assets/themes/j1/modules/log4javascript/docs/distribution.html +87 -0
- data/assets/themes/j1/modules/log4javascript/docs/index.html +190 -0
- data/assets/themes/j1/modules/log4javascript/docs/lite.html +182 -0
- data/assets/themes/j1/modules/log4javascript/docs/manual.html +3217 -0
- data/assets/themes/j1/modules/log4javascript/docs/manual_lite.html +383 -0
- data/assets/themes/j1/modules/log4javascript/docs/quickstart.html +230 -0
- data/assets/themes/j1/modules/log4javascript/docs/whatsnew.html +86 -0
- data/assets/themes/j1/modules/log4javascript/js/log4javascript.js +5826 -0
- data/assets/themes/j1/modules/{util/js/log4javascript.js → log4javascript/js/log4javascript.min.js} +17 -0
- data/exe/j1 +1 -1
- data/lib/j1/commands/generate.rb +32 -9
- data/lib/{patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.6 → j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.7}/fastfilereaderext.so +0 -0
- data/lib/{patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.6 → j1/patches/rubygems/eventmachine-1.2.7-x64-mingw32/lib/2.7}/rubyeventmachine.so +0 -0
- data/lib/j1/patches/rubygems/execjs-2.7.0/lib/execjs/external_runtime.rb +246 -0
- data/lib/j1/version.rb +1 -1
- data/lib/j1_app.rb +1 -1
- data/lib/j1_app/j1_auth_manager/auth_manager.rb +8 -2
- data/lib/j1_app/j1_site_manager/static_site.no-cross-origin.rb +94 -0
- data/lib/j1_app/j1_site_manager/static_site.rb +13 -11
- data/lib/starter_web/Gemfile +20 -14
- data/lib/starter_web/_config.yml +6 -47
- data/lib/starter_web/_data/_defaults/j1_config.yml +460 -0
- data/lib/starter_web/_data/{private.yml@localhost → _defaults/private.yml} +8 -51
- data/lib/starter_web/_data/_defaults/resources.yml +626 -325
- data/lib/starter_web/_data/apps/defaults/{justified_gallery.yml → justifiedGallery.yml} +2 -2
- data/lib/starter_web/_data/apps/defaults/{gallery_customizer.yml → justifiedGalleryCustomizer.yml} +0 -0
- data/lib/starter_web/_data/apps/defaults/{light_gallery.yml → lightGallery.yml} +0 -0
- data/lib/starter_web/_data/apps/{justified_gallery.yml → justifiedGallery.yml} +7 -7
- data/lib/starter_web/_data/apps/{gallery_customizer.yml → justifiedGalleryCustomizer.yml} +0 -0
- data/lib/starter_web/_data/apps/{light_gallery.yml → lightGallery.yml} +0 -0
- data/lib/starter_web/_data/blocks/banner.yml +18 -30
- data/lib/starter_web/_data/blocks/footer.yml +15 -3
- data/lib/starter_web/_data/blocks/panel.yml +4 -6
- data/lib/starter_web/_data/j1_config.yml +8 -7
- data/lib/starter_web/_data/modules/authentication.yml +11 -100
- data/lib/starter_web/_data/modules/defaults/log4javascript.yml +37 -40
- data/lib/starter_web/_data/modules/defaults/quicksearch.yml +2 -0
- data/lib/starter_web/_data/modules/log4javascript.yml +11 -83
- data/lib/starter_web/_data/modules/navigator_menu.yml +25 -6
- data/lib/starter_web/_data/modules/quicksearch.yml +2 -0
- data/lib/starter_web/_data/plugins/defaults/paginator.yml +15 -12
- data/lib/starter_web/_data/plugins/paginator.yml +5 -3
- data/lib/starter_web/_data/private.yml +29 -57
- data/lib/starter_web/_data/private@default.yml +119 -0
- data/lib/starter_web/_data/private@localhost.yml +156 -0
- data/lib/starter_web/_data/resources.yml +33 -16
- data/lib/starter_web/_data/utilities/defaults/util_srv.yml +49 -3
- data/lib/starter_web/_data/utilities/util_srv.yml +8 -65
- data/lib/starter_web/_includes/attributes.asciidoc +9 -6
- data/lib/starter_web/_plugins/asciidoctor-extensions/callout.rb +47 -5
- data/lib/starter_web/_plugins/asciidoctor-extensions/conum.rb +28 -1
- data/lib/starter_web/_plugins/lunr_index.rb +17 -2
- data/lib/starter_web/assets/images/collections/blog/featured/dynamic-web-access.png +0 -0
- data/lib/starter_web/assets/images/collections/blog/featured/jamstack-generators.gif +0 -0
- data/lib/starter_web/assets/images/collections/blog/featured/jamstack-generators.jpg +0 -0
- data/lib/starter_web/assets/images/collections/blog/featured/static-web-access.png +0 -0
- data/lib/starter_web/assets/images/modules/attics/leon-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/machine-generator-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/icons/j1/j1-256x256.gif +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +44 -45
- data/lib/starter_web/collections/posts/public/featured/_posts/{2020-06-01-about-cookies.adoc → 2020-01-01-about-cookies.adoc} +43 -41
- data/lib/starter_web/collections/posts/public/featured/_posts/{2020-05-01-top-site-generators.adoc → 2021-03-01-site-generators.adoc} +57 -30
- data/lib/starter_web/collections/posts/public/featured/_posts/2021-03-03-about-j1.adoc +125 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/_includes/attributes.asciidoc +4 -0
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-test-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-test-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-04-post-test-series.adoc +1 -1
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-20-minneapolis.adoc +1 -1
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-24-narcisse-snake-dens.adoc +1 -1
- data/lib/starter_web/collections/posts/public/wikipedia/_posts/2016-11-26-columbia-river.adoc +1 -1
- data/lib/starter_web/dot.gitattributes +1 -1
- data/lib/starter_web/dot.gitignore +5 -1
- data/lib/starter_web/package.json +3 -2
- data/lib/starter_web/pages/public/asciidoc_skeletons/_templates/asciidoc-extensions/gallery.asciidoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/200_chapter.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.adoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/200_chapter.asciidoc +1 -1
- data/lib/starter_web/pages/public/asciidoc_skeletons/multi-document/multi.adoc +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/dateview.html +2 -2
- data/lib/starter_web/pages/public/blog/navigator/archive/tagview.html +1 -1
- data/lib/starter_web/pages/public/blog/navigator/index.html +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +44 -47
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +20 -19
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +5 -1
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +38 -34
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +37 -35
- data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +15 -13
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +10 -8
- data/lib/starter_web/pages/public/learn/roundtrip/500_themes.adoc +29 -26
- data/lib/starter_web/pages/public/learn/roundtrip/600_quicksearch.adoc +49 -48
- data/lib/starter_web/pages/public/learn/roundtrip/_includes/documents/100_gistblock.asciidoc +1 -1
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +43 -16
- data/lib/starter_web/pages/public/legal/en/100_copyright.adoc +114 -0
- data/lib/starter_web/pages/public/legal/en/200_impress.adoc +81 -0
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +70 -48
- data/lib/starter_web/pages/public/legal/en/400_comment_policy.adoc +121 -0
- data/lib/starter_web/pages/public/panels/intro_panel/panel.adoc +78 -70
- data/lib/starter_web/pages/public/previewer/justified_gallery.html +2 -2
- data/lib/starter_web/pages/public/previewer/md_color_palette.adoc +0 -1939
- data/lib/starter_web/pages/public/previewer/mdi_icons_preview.adoc +6 -8
- data/lib/starter_web/utilsrv/_defaults/package.json +13 -9
- data/lib/starter_web/utilsrv/package.json +6 -2
- data/lib/starter_web/utilsrv/server.js +228 -55
- metadata +45 -214
- data/assets/data/menu.1.html +0 -505
- data/lib/starter_web/_data/_defaults/j1_light_gallery.yml +0 -110
- data/lib/starter_web/_data/_defaults/template_settings.yml +0 -258
- data/lib/starter_web/_data/plugins/defaults/notebooks.yml +0 -61
- data/lib/starter_web/_data/plugins/notebooks.yml +0 -70
- data/lib/starter_web/assets/images/collections/blog/featured/staticgen.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/aditya-joshi-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/alex-holyoake-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/anaya-katlego-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/antonella-lombardi-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/antonino-visalli-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/docker-1280x600-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/jekyll.1200x600-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/signpost-1920x800-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/water-journal-1280x600.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/banner/write-1280x600-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/brandon-mowinkel-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/daniel-jensen-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/florian-olivo-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/giammarco-boscaro-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/go-up-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/ian-schneider-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/jason-rosewell-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/joel-filipe-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/lianhao-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/library-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280-v.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/mae-mue-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/markus-spiske-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/markus-spiske.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/markus-spiske3-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/modules-apps-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/nicola-styles-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/no-time-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/nousnou-iwasaki-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/premium-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/responsive-text-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/robert-v-ruggiero-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/romain-vignes-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/spider-web-1920x1200-bw.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/the-place-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/icons/algolia/search-by-algolia.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/d1/d1-256x256.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/d1/d1-32x32.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/d1/d1-512x512.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/d1/d1-64x64.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/d1/d1.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/d1/favicon.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/d1/scalable/d1.svg +0 -2025
- data/lib/starter_web/assets/images/modules/icons/netlify/nf-logo.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/p1/favicon.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/p1/p1-256x256.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/p1/p1-32x32.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/p1/p1-512x512.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/p1/p1-64x64.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/p1/p1.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/p1/scalable/p1.svg +0 -2020
- data/lib/starter_web/assets/images/modules/icons/patreon/favicon-16x16.png +0 -0
- data/lib/starter_web/assets/images/modules/icons/patreon/favicon-32x32.png +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/000_browser_console-1280x600.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/001_smee_channel-1280x400.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/002_gh_repo_settings-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/003_gh_webhook_settings-1280x1000.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/004_gh_webhook_settings-post-1280x600.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/005_smee_channel_ping_receive-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/006_gh_redeliver_payload-1280x900.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/007_receive_redelivered_payload-1280x800.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/000_browser_console.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/000_smee_channel.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/002_gh_repo-settings.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/003_gh_webhook_settings.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/004_gh_webhook_settings-post.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/005_smee_channel_ping_received.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/006_gh_redeliver_payload.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/007_receive_redelivered_payload.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/base/webhook_flow.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/flows/webhook_flow-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/pages/j1_webhooks/scaleable/webhook_flow.svg +0 -432
- data/lib/starter_web/assets/images/pages/j1_webhooks/uml/auth_mgmr_signin_request_flow.uxf +0 -632
- data/lib/starter_web/assets/images/pages/j1_webhooks/uml/webhook_flow.uxf +0 -648
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/get-started-1920x1280-bw.jpg +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/130_layout_inheritance.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/content_inheritance.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/content_inheritance_thumb.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/html_layout.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1-quickstart-windows.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1-template-theme.jpg +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/j1_layout.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/jekyll-minima-theme.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/lane_inheritance.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/intro/layout_inheritance.png +0 -0
- data/lib/starter_web/assets/images/pages/kickstarter/web_in_a_day/preparations/msys_installation.jpg +0 -0
- data/lib/starter_web/assets/images/pages/log4j/apache-log4j-logo.png +0 -0
- data/lib/starter_web/assets/images/pages/log4r/code-1920x600.jpg +0 -0
- data/lib/starter_web/assets/images/pages/log4r/log4r-logo.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_000.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_001.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_002.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_003.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_004.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_005.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_006.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_007.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_008.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_009.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_010.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_011.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_012.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_013.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_014.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_015.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_016.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_017.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_018.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_019.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_020.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_021.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_022.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_023.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_024.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_025.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_026.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_027.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_028.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_029.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_030.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_031.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_032.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_033.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_034.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_035.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_036.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_037.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_038.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_039.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_040.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_041.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_042.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_043.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_044.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_045.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_046.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_047.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_048.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_049.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_050.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_051.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_052.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_053.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_054.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_055.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_056.png +0 -0
- data/lib/starter_web/assets/images/pages/log_expert/image_057.png +0 -0
- data/lib/starter_web/assets/images/pages/material/apple-touch-icon.png +0 -0
- data/lib/starter_web/assets/images/pages/pen/jquery/jQuery-logo.png +0 -0
- data/lib/starter_web/assets/images/pages/pen/jquery/jquery-banner-1280x600.jpg +0 -0
- data/lib/starter_web/assets/images/pages/pen/jquery/jquery-banner-1920x800.jpg +0 -0
- data/lib/starter_web/assets/images/pages/pen/jquery/src/JQuery-Logo.svg +0 -122
- data/lib/starter_web/assets/images/pages/pen/jquery/src/banner.psd +0 -0
- data/lib/starter_web/assets/images/pages/winlogbeat/coordinate-map.png +0 -0
- data/lib/starter_web/assets/images/pages/winlogbeat/kibana-powershell.jpg +0 -0
- data/lib/starter_web/assets/images/pages/winlogbeat/option_ignore_outgoing.png +0 -0
- data/lib/starter_web/assets/images/pages/winlogbeat/winlogbeat-dashboard.png +0 -0
- data/lib/starter_web/assets/images/pages/writers_guide/1280px-PDCA_Process.png +0 -0
- data/lib/starter_web/assets/images/pages/writers_guide/annie-spratt-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/pages/writers_guide/deming-cycle.png +0 -0
- data/lib/starter_web/assets/images/pages/writers_guide/humble-lamb-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/pages/writers_guide/john-schnobrich-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/pages/writers_guide/sigmund-1920x1280.jpg +0 -0
- data/lib/starter_web/pages/protected/site_search.adoc +0 -180
- data/lib/starter_web/pages/public/asciidoc_skeletons/book/book.pdf +1 -5439
- data/lib/starter_web/pages/public/legal/en/000_copyright.adoc +0 -93
- data/lib/starter_web/pages/public/legal/en/100_impress.adoc +0 -55
- data/lib/starter_web/pages/public/legal/en/200_terms_of_use.adoc +0 -53
- data/lib/starter_web/pages/public/legal/en/eu/cookie.policy.asciidoc +0 -50
@@ -0,0 +1,3217 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
4
|
+
<head>
|
5
|
+
<title>log4javascript 1.4 manual</title>
|
6
|
+
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
7
|
+
<meta name="author" content="Tim Down - tim@log4javascript.org" />
|
8
|
+
<meta name="description" content="log4javascript, a logging framework for JavaScript based on log4j" />
|
9
|
+
<meta name="robots" content="all" />
|
10
|
+
<link rel="stylesheet" type="text/css" media="screen,print" href="../main.css" title="Default" />
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<div id="container" class="nonav">
|
14
|
+
<div id="header">
|
15
|
+
<h1><a href="index.html">log4javascript</a></h1>
|
16
|
+
</div>
|
17
|
+
<div id="content">
|
18
|
+
<div id="nav">
|
19
|
+
<a class="navitem" href="../index.html">home</a>
|
20
|
+
| <a class="navitem" href="http://sourceforge.net/projects/log4javascript" target="_blank" title="Download (opens in new window)">download</a>
|
21
|
+
| <a class="navitem" href="index.html">docs</a>
|
22
|
+
| <a class="navitem" href="quickstart.html">quick start</a>
|
23
|
+
| <a class="navitem" href="../demos/index.html">demos</a>
|
24
|
+
| <a class="navitem" href="http://log4javascript.org" target="_blank">website</a>
|
25
|
+
| <a class="navitem" href="http://www.timdown.co.uk" target="_blank">timdown.co.uk</a>
|
26
|
+
</div>
|
27
|
+
<h1>log4javascript 1.4 manual</h1>
|
28
|
+
<h2>Contents</h2>
|
29
|
+
<ul>
|
30
|
+
<li><a href="#intro">Introduction</a></li>
|
31
|
+
<li><a href="#amd">AMD</a></li>
|
32
|
+
<li><a href="#noteaboutlog4javascript">Note about the log4javascript object</a></li>
|
33
|
+
<li>
|
34
|
+
<a href="#loggersappenderslayoutslevels">Loggers, appenders, layouts and levels</a>
|
35
|
+
<ul>
|
36
|
+
<li><a href="#configuration">Configuring appenders</a></li>
|
37
|
+
<li><a href="#loggersappenderslayoutslevelsexample">Example</a></li>
|
38
|
+
</ul>
|
39
|
+
</li>
|
40
|
+
<li><a href="#log4javascript">log4javascript static properties/methods</a></li>
|
41
|
+
<li><a href="#levels">Levels</a></li>
|
42
|
+
<li><a href="#loggers">Loggers</a></li>
|
43
|
+
<li>
|
44
|
+
<a href="#appenders">Appenders</a>
|
45
|
+
<ul>
|
46
|
+
<li><a href="#appender">Appender</a></li>
|
47
|
+
<li><a href="#alertappender">AlertAppender</a></li>
|
48
|
+
<li><a href="#ajaxappender">AjaxAppender</a></li>
|
49
|
+
<li><a href="#popupappender">PopUpAppender</a></li>
|
50
|
+
<li><a href="#inpageappender">InPageAppender</a></li>
|
51
|
+
<li><a href="#browserconsoleappender">BrowserConsoleAppender</a></li>
|
52
|
+
</ul>
|
53
|
+
</li>
|
54
|
+
<li>
|
55
|
+
<a href="#layouts">Layouts</a>
|
56
|
+
<ul>
|
57
|
+
<li><a href="#layout">Layout</a></li>
|
58
|
+
<li><a href="#nulllayout">NullLayout</a></li>
|
59
|
+
<li><a href="#simplelayout">SimpleLayout</a></li>
|
60
|
+
<li><a href="#patternlayout">PatternLayout</a></li>
|
61
|
+
<li><a href="#xmllayout">XmlLayout</a></li>
|
62
|
+
<li><a href="#jsonlayout">JsonLayout</a></li>
|
63
|
+
<li><a href="#httppostdatalayout">HttpPostDataLayout</a></li>
|
64
|
+
</ul>
|
65
|
+
</li>
|
66
|
+
<li><a href="#enabling">Enabling / disabling log4javascript</a></li>
|
67
|
+
<li>
|
68
|
+
<a href="#errorhandling">log4javascript error handling</a>
|
69
|
+
<ul>
|
70
|
+
<li><a href="#loglog">LogLog</a></li>
|
71
|
+
</ul>
|
72
|
+
</li>
|
73
|
+
<li><a href="#differences">Differences between log4javascript and log4j</a></li>
|
74
|
+
</ul>
|
75
|
+
<div id="intro">
|
76
|
+
<h2>Introduction</h2>
|
77
|
+
<p>
|
78
|
+
log4javascript currently exists to provide more flexible and configurable JavaScript logging
|
79
|
+
than that provided by browser developer tools. It works a very wide range of browsers. It was
|
80
|
+
originally written to ease the pain of JavaScript debugging in the days before browsers came
|
81
|
+
with advanced developer tools.
|
82
|
+
</p>
|
83
|
+
<p>
|
84
|
+
It requires only a JavaScript include and one line of code to initialize with default settings.
|
85
|
+
Having for several years used log4j and its .NET port log4net, it was natural for me to
|
86
|
+
base it on log4j.
|
87
|
+
</p>
|
88
|
+
<p class="linktotop">
|
89
|
+
<a href="#container">Top</a>
|
90
|
+
</p>
|
91
|
+
</div>
|
92
|
+
<div id="amd">
|
93
|
+
<h2>AMD</h2>
|
94
|
+
<p>
|
95
|
+
Since version 1.4.10, log4javascript comes with AMD support hence can be loaded by a script
|
96
|
+
loader such as <a href="http://requirejs.org/" title="RequireJS website (opens in new window)"
|
97
|
+
target="_blank">RequireJS</a>.
|
98
|
+
</p>
|
99
|
+
<p>
|
100
|
+
The current version of JavaScript is designed only to run in a browser. If not using AMD,
|
101
|
+
log4javascript creates a single property of the global object (to all intents and purposes, a
|
102
|
+
global variable) called <code>log4javascript</code>.
|
103
|
+
</p>
|
104
|
+
<p class="linktotop">
|
105
|
+
<a href="#container">Top</a>
|
106
|
+
</p>
|
107
|
+
</div>
|
108
|
+
<div id="noteaboutlog4javascript">
|
109
|
+
<h2>Note about the log4javascript object</h2>
|
110
|
+
<p>
|
111
|
+
All of log4javascript's instantiable classes are accessible via the log4javascript object, which
|
112
|
+
acts as a namespace. Therefore references to all class names must be preceded with
|
113
|
+
"log4javascript.". For example:
|
114
|
+
</p>
|
115
|
+
<p>
|
116
|
+
<code>var popUpAppender = new log4javascript.PopUpAppender();</code>
|
117
|
+
</p>
|
118
|
+
<p class="linktotop">
|
119
|
+
<a href="#container">Top</a>
|
120
|
+
</p>
|
121
|
+
</div>
|
122
|
+
<div id="loggersappenderslayoutslevels">
|
123
|
+
<h2>Loggers, Appenders, Layouts and Levels</h2>
|
124
|
+
<p>
|
125
|
+
A <em>logger</em> in log4javascript is the object on which log calls are
|
126
|
+
made. A logger may be assigned zero or more <em>appenders</em>.
|
127
|
+
An appender is an object that actually does the logging: for example,
|
128
|
+
a <code><a href="#popupappender">PopUpAppender</a></code> logs messages to
|
129
|
+
a pop-up console window while an <code><a href="#ajaxappender">AjaxAppender</a></code>
|
130
|
+
uses HTTP to send log messages back to the server. Each appender is assigned
|
131
|
+
a <em>layout</em>, which is responsible for formatting log messages that
|
132
|
+
are passed to an appender.
|
133
|
+
</p>
|
134
|
+
<p>
|
135
|
+
Every log message has a <em>level</em>. This is the severity of the message.
|
136
|
+
Available levels are <code>TRACE</code>, <code>DEBUG</code>, <code>INFO</code>,
|
137
|
+
<code>WARN</code>, <code>ERROR</code> and <code>FATAL</code> - these correspond to
|
138
|
+
the logging methods <code>trace</code>, <code>debug</code>, <code>info</code>,
|
139
|
+
<code>warn</code>, <code>error</code> and <code>fatal</code> of <code>Logger</code>.
|
140
|
+
Levels are ordered as follows: <code>TRACE</code> < <code>DEBUG</code> <
|
141
|
+
<code>INFO</code> < <code>WARN</code> < <code>ERROR</code> <
|
142
|
+
<code>FATAL</code>. This means the <code>FATAL</code> is the most severe and
|
143
|
+
<code>TRACE</code> the least. Also included are levels called <code>ALL</code>
|
144
|
+
and <code>OFF</code> intended to enable or disable all logging respectively.
|
145
|
+
</p>
|
146
|
+
<p>
|
147
|
+
Both loggers and appenders also have threshold levels (by default, <code>DEBUG</code>
|
148
|
+
for loggers and <code>ALL</code> for appenders).
|
149
|
+
Setting a level to either a logger or an appender disables log messages of severity
|
150
|
+
lower than that level. For instance, if a level of <code>INFO</code> is set on a
|
151
|
+
logger then only log messages of severity <code>INFO</code> or greater will be logged,
|
152
|
+
meaning <code>DEBUG</code> and <code>TRACE</code> messages will not be logged. If the
|
153
|
+
same logger had two appenders, one of level <code>DEBUG</code> and one of level
|
154
|
+
<code>WARN</code> then the first appender will still only log messages of
|
155
|
+
<code>INFO</code> or greater while the second appender will only log messages of level
|
156
|
+
<code>WARN</code> or greater.
|
157
|
+
</p>
|
158
|
+
<p>
|
159
|
+
This allows the developer fine control over which messages get logged where.
|
160
|
+
</p>
|
161
|
+
<div id="configuration">
|
162
|
+
<h3>Configuring appenders</h3>
|
163
|
+
<p>
|
164
|
+
From version 1.4, <strong>configuring appenders is only possible via configuration
|
165
|
+
methods</strong>. As the number of configuration options increases it becomes increasingly
|
166
|
+
undesirable to use constructor parameters, so support for it has been dropped.
|
167
|
+
</p>
|
168
|
+
</div>
|
169
|
+
<div id="loggersappenderslayoutslevelsexample">
|
170
|
+
<h3>Example</h3>
|
171
|
+
<p>
|
172
|
+
<strong>NB.</strong> The Ajax side of this example relies on having
|
173
|
+
server-side processing in place.
|
174
|
+
</p>
|
175
|
+
<p>
|
176
|
+
First, log4javascript is initialized, and a logger (actually the
|
177
|
+
anonymous logger) is assigned to a variable called <code>log</code>:
|
178
|
+
</p>
|
179
|
+
<pre class="code">
|
180
|
+
<script type="text/javascript" src="log4javascript.js"></script>
|
181
|
+
<script type="text/javascript">
|
182
|
+
//<![CDATA[
|
183
|
+
var log = log4javascript.getLogger();
|
184
|
+
</pre>
|
185
|
+
<p>
|
186
|
+
<code>log</code> does not yet have any appenders, so a call to <code>log.debug()</code>
|
187
|
+
will do nothing as yet. For this example we will use a
|
188
|
+
<code><a href="#popupappender">PopUpAppender</a></code> for debugging purposes.
|
189
|
+
Since the lifespan of the messages displayed in the pop-up is only going to be the
|
190
|
+
same as that of the window, a <code><a href="#patternlayout">PatternLayout</a></code>
|
191
|
+
is used that displays the time of the message and not the date (note that this is
|
192
|
+
also true of PopUpAppender's default layout). The format of the string passed into
|
193
|
+
PatternLayout is explained <a href="#patternlayout">below</a>.
|
194
|
+
</p>
|
195
|
+
<pre class="code">
|
196
|
+
var popUpAppender = new log4javascript.PopUpAppender();
|
197
|
+
var popUpLayout = new log4javascript.PatternLayout("%d{HH:mm:ss} %-5p - %m%n");
|
198
|
+
popUpAppender.setLayout(popUpLayout);
|
199
|
+
log.addAppender(popUpAppender);
|
200
|
+
</pre>
|
201
|
+
<p>
|
202
|
+
Suppose that we also want to send log messages to the server, but limited to
|
203
|
+
error messages only. To achieve this we use an
|
204
|
+
<code><a href="#ajaxappender">AjaxAppender</a></code>. Note that if no layout is
|
205
|
+
specified then for convenience a default layout is used; in the case of
|
206
|
+
AjaxAppender, that is <code><a href="#httppostdatalayout">HttpPostDataLayout</a></code>,
|
207
|
+
which formats log messages as a standard HTTP POST string from which a simple
|
208
|
+
server-side script (not provided with log4javascript) will be able to extract
|
209
|
+
posted parameters. This is fine for our purposes:
|
210
|
+
</p>
|
211
|
+
<pre class="code">
|
212
|
+
var ajaxAppender = new log4javascript.AjaxAppender("myloggingservlet.do");
|
213
|
+
ajaxAppender.setThreshold(log4javascript.Level.<code>ERROR</code>);
|
214
|
+
log.addAppender(ajaxAppender);
|
215
|
+
</pre>
|
216
|
+
<p>
|
217
|
+
Finally, some test log messages and the closing script tag:
|
218
|
+
</p>
|
219
|
+
<pre class="code">
|
220
|
+
log.debug("Debugging message (appears in pop-up)");
|
221
|
+
log.error("Error message (appears in pop-up and in server log)");
|
222
|
+
//]]>
|
223
|
+
</script>
|
224
|
+
</pre>
|
225
|
+
<p>
|
226
|
+
The full script:
|
227
|
+
</p>
|
228
|
+
<pre class="code">
|
229
|
+
<script type="text/javascript" src="log4javascript.js"></script>
|
230
|
+
<script type="text/javascript">
|
231
|
+
//<![CDATA[
|
232
|
+
var log = log4javascript.getLogger();
|
233
|
+
var popUpAppender = new log4javascript.PopUpAppender();
|
234
|
+
var popUpLayout = new log4javascript.PatternLayout("%d{HH:mm:ss} %-5p - %m%n");
|
235
|
+
popUpAppender.setLayout(popUpLayout);
|
236
|
+
log.addAppender(popUpAppender);
|
237
|
+
var ajaxAppender = new log4javascript.AjaxAppender("myloggingservlet.do");
|
238
|
+
ajaxAppender.setThreshold(log4javascript.Level.ERROR);
|
239
|
+
log.addAppender(ajaxAppender);
|
240
|
+
log.debug("Debugging message (appears in pop-up)");
|
241
|
+
log.error("Error message (appears in pop-up and in server log)");
|
242
|
+
//]]>
|
243
|
+
</script>
|
244
|
+
</pre>
|
245
|
+
<p>
|
246
|
+
<a href="../examples/example_manual.html" title="View example (opens in new window)"
|
247
|
+
target="_blank">See this example in action</a> (opens in new window)
|
248
|
+
</p>
|
249
|
+
</div>
|
250
|
+
<p class="linktotop">
|
251
|
+
<a href="#container">Top</a>
|
252
|
+
</p>
|
253
|
+
</div>
|
254
|
+
<div id="log4javascript">
|
255
|
+
<h2>log4javascript static properties/methods</h2>
|
256
|
+
<h4>Properties</h4>
|
257
|
+
<ul class="propertieslist">
|
258
|
+
<li class="property">
|
259
|
+
<div class="name">version</div>
|
260
|
+
<div class="summary">
|
261
|
+
The version number of your copy of log4javascript.
|
262
|
+
</div>
|
263
|
+
</li>
|
264
|
+
<li class="property">
|
265
|
+
<div class="name">edition</div>
|
266
|
+
<div class="summary">
|
267
|
+
The edition of your copy of log4javascript.
|
268
|
+
</div>
|
269
|
+
</li>
|
270
|
+
<li class="property">
|
271
|
+
<div class="name">logLog</div>
|
272
|
+
<div class="summary">
|
273
|
+
log4javascript's internal logging object. <a href="#loglog">See below for more details</a>.
|
274
|
+
</div>
|
275
|
+
</li>
|
276
|
+
</ul>
|
277
|
+
<h4>Methods</h4>
|
278
|
+
<ul class="propertieslist">
|
279
|
+
<li class="method">
|
280
|
+
<div class="name">getLogger</div>
|
281
|
+
<div class="methodsignature"><code>Logger <strong>getLogger</strong>([String <em>loggerName</em>])</code></div>
|
282
|
+
<div class="paramsheading">Parameters:</div>
|
283
|
+
<ul class="params">
|
284
|
+
<li class="param">
|
285
|
+
<code class="paramname">loggerName</code>
|
286
|
+
[<em>optional</em>]
|
287
|
+
</li>
|
288
|
+
</ul>
|
289
|
+
<div class="summary">
|
290
|
+
<p>
|
291
|
+
Returns a logger with the specified name, creating it if a logger with that name does not
|
292
|
+
already exist. If no name is specified, a logger is returned with name <code>[anonymous]</code>, and
|
293
|
+
subsequent calls to <code>getLogger()</code> (with no logger name specified) will return
|
294
|
+
this same logger object.
|
295
|
+
</p>
|
296
|
+
<p>
|
297
|
+
Note that the names <code>[anonymous]</code>, <code>[default]</code>, <code>[null]</code>
|
298
|
+
and <code>root</code> are reserved for
|
299
|
+
the anonymous logger, default logger, null logger and root logger respectively.
|
300
|
+
</p>
|
301
|
+
</div>
|
302
|
+
</li>
|
303
|
+
<li class="method">
|
304
|
+
<div class="name">getDefaultLogger</div>
|
305
|
+
<div class="methodsignature"><code>Logger <strong>getDefaultLogger</strong>()</code></div>
|
306
|
+
<div class="summary">
|
307
|
+
<p>
|
308
|
+
Convenience method that returns the default logger. In the standard edition, the
|
309
|
+
default logger has a single appender: a
|
310
|
+
<code><a href="#popupappender">PopUpAppender</a></code> with the default layout,
|
311
|
+
width and height, and with <code>focusPopUp</code> set to false and
|
312
|
+
<code>lazyInit</code>, <code>useOldPopUp</code> and
|
313
|
+
<code>complainAboutPopUpBlocking</code> all set to true.
|
314
|
+
</p>
|
315
|
+
<p>
|
316
|
+
In the production edition, the default logger has no appenders.
|
317
|
+
</p>
|
318
|
+
</div>
|
319
|
+
</li>
|
320
|
+
<li class="method">
|
321
|
+
<div class="name">getNullLogger</div>
|
322
|
+
<div class="methodsignature"><code>Logger <strong>getNullLogger</strong>()</code></div>
|
323
|
+
<div class="summary">
|
324
|
+
Returns an empty logger with no appenders. Useful for disabling all logging.
|
325
|
+
</div>
|
326
|
+
</li>
|
327
|
+
<li class="method">
|
328
|
+
<div class="name">getRootLogger</div>
|
329
|
+
<div class="methodsignature"><code>Logger <strong>getRootLogger</strong>()</code></div>
|
330
|
+
<div class="summary">
|
331
|
+
Returns the root logger from which all other loggers derive.
|
332
|
+
</div>
|
333
|
+
</li>
|
334
|
+
<li class="method">
|
335
|
+
<div class="name">resetConfiguration</div>
|
336
|
+
<div class="methodsignature"><code>void <strong>resetConfiguration</strong>()</code></div>
|
337
|
+
<div class="summary">
|
338
|
+
Resets the all loggers to their default level.
|
339
|
+
</div>
|
340
|
+
</li>
|
341
|
+
<li class="method">
|
342
|
+
<div class="name">setEnabled</div>
|
343
|
+
<div class="methodsignature"><code>void <strong>setEnabled</strong>(Boolean <em>enabled</em>)</code></div>
|
344
|
+
<div class="paramsheading">Parameters:</div>
|
345
|
+
<ul class="params">
|
346
|
+
<li class="param">
|
347
|
+
<code class="paramname">enabled</code>
|
348
|
+
</li>
|
349
|
+
</ul>
|
350
|
+
<div class="summary">
|
351
|
+
Enables or disables all logging, depending on <code>enabled</code>.
|
352
|
+
</div>
|
353
|
+
</li>
|
354
|
+
<li class="method">
|
355
|
+
<div class="name">isEnabled</div>
|
356
|
+
<div class="methodsignature"><code>Boolean <strong>isEnabled</strong>()</code></div>
|
357
|
+
<div class="summary">
|
358
|
+
Returns true or false depending on whether logging is enabled.
|
359
|
+
</div>
|
360
|
+
</li>
|
361
|
+
<li class="method" id="log4javascriptaddeventlistener">
|
362
|
+
<div class="name">addEventListener</div>
|
363
|
+
<div class="methodsignature"><code>void <strong>addEventListener</strong>(String <em>eventType</em>, Function <em>listener</em>)</code></div>
|
364
|
+
<div class="paramsheading">Parameters:</div>
|
365
|
+
<ul class="params">
|
366
|
+
<li class="param">
|
367
|
+
<code class="paramname">eventType</code>
|
368
|
+
</li>
|
369
|
+
<li class="param">
|
370
|
+
<code class="paramname">listener</code>
|
371
|
+
</li>
|
372
|
+
</ul>
|
373
|
+
<div class="summary">
|
374
|
+
<p>
|
375
|
+
Adds a function to be called when an event of the type specified occurs in log4javascript.
|
376
|
+
Supported event types are <code>load</code> (occurs once the page has loaded) and
|
377
|
+
<code>error</code>.
|
378
|
+
</p>
|
379
|
+
<p>
|
380
|
+
Each listener is pased three paramaters:
|
381
|
+
</p>
|
382
|
+
<ul>
|
383
|
+
<li><code>sender</code>. The object that raised the event (i.e. the log4javascript object);</li>
|
384
|
+
<li><code>eventType</code>. The type of the event;</li>
|
385
|
+
<li>
|
386
|
+
<code>eventArgs</code>. An object containing of event-specific arguments. For the <code>error</code> event,
|
387
|
+
this is an object with properties <code>message</code> and <code>exception</code>. For the <code>load</code>
|
388
|
+
event this is an empty object.
|
389
|
+
</li>
|
390
|
+
</ul>
|
391
|
+
</div>
|
392
|
+
</li>
|
393
|
+
<li class="method">
|
394
|
+
<div class="name">removeEventListener</div>
|
395
|
+
<div class="methodsignature"><code>void <strong>removeEventListener</strong>(String <em>eventType</em>, Function <em>listener</em>)</code></div>
|
396
|
+
<div class="paramsheading">Parameters:</div>
|
397
|
+
<ul class="params">
|
398
|
+
<li class="param">
|
399
|
+
<code class="paramname">eventType</code>
|
400
|
+
</li>
|
401
|
+
<li class="param">
|
402
|
+
<code class="paramname">listener</code>
|
403
|
+
</li>
|
404
|
+
</ul>
|
405
|
+
<div class="summary">
|
406
|
+
Removes the event listener function supplied for the event of the type specified.
|
407
|
+
</div>
|
408
|
+
</li>
|
409
|
+
<li class="method">
|
410
|
+
<div class="name">dispatchEvent</div>
|
411
|
+
<div class="methodsignature"><code>void <strong>dispatchEvent</strong>(String <em>eventType</em>, Object <em>eventArgs</em>)</code></div>
|
412
|
+
<div class="paramsheading">Parameters:</div>
|
413
|
+
<ul class="params">
|
414
|
+
<li class="param">
|
415
|
+
<code class="paramname">eventType</code>
|
416
|
+
</li>
|
417
|
+
<li class="param">
|
418
|
+
<code class="paramname">eventArgs</code>
|
419
|
+
</li>
|
420
|
+
</ul>
|
421
|
+
<div class="summary">
|
422
|
+
Raises an event of type <code>eventType</code> on the <code>log4javascript</code> object.
|
423
|
+
Each of the listeners for this type of event (registered via <code>addEventListener</code>)
|
424
|
+
is called and passed <code>eventArgs</code> as the third parameter.
|
425
|
+
</div>
|
426
|
+
</li>
|
427
|
+
<li class="method">
|
428
|
+
<div class="name">setEventTypes</div>
|
429
|
+
<div class="methodsignature"><code>void <strong>setEventTypes</strong>(Array <em>eventTypes</em>)</code></div>
|
430
|
+
<div class="paramsheading">Parameters:</div>
|
431
|
+
<ul class="params">
|
432
|
+
<li class="param">
|
433
|
+
<code class="paramname">eventTypes</code>
|
434
|
+
</li>
|
435
|
+
</ul>
|
436
|
+
<div class="summary">
|
437
|
+
Used internally to specify the types of events that the <code>log4javascript</code> object can raise.
|
438
|
+
</div>
|
439
|
+
</li>
|
440
|
+
<li class="method">
|
441
|
+
<div class="name">setShowStackTraces</div>
|
442
|
+
<div class="methodsignature"><code>void <strong>setShowStackTraces</strong>(Boolean <em>show</em>)</code></div>
|
443
|
+
<div class="paramsheading">Parameters:</div>
|
444
|
+
<ul class="params">
|
445
|
+
<li class="param">
|
446
|
+
<code class="paramname">show</code>
|
447
|
+
</li>
|
448
|
+
</ul>
|
449
|
+
<div class="summary">
|
450
|
+
Enables or disables displaying of error stack traces, depending on <code>show</code>.
|
451
|
+
By default, stack traces are not displayed. (Only works in Firefox)
|
452
|
+
</div>
|
453
|
+
</li>
|
454
|
+
<li class="method">
|
455
|
+
<div class="name">evalInScope</div>
|
456
|
+
<div class="methodsignature"><code>Object <strong>evalInScope</strong>(String <em>expr</em>)</code></div>
|
457
|
+
<div class="paramsheading">Parameters:</div>
|
458
|
+
<ul class="params">
|
459
|
+
<li class="param">
|
460
|
+
<code class="paramname">expr</code>
|
461
|
+
</li>
|
462
|
+
</ul>
|
463
|
+
<div class="summary">
|
464
|
+
This evaluates the given expression in the log4javascript scope, thus allowing
|
465
|
+
scripts to access internal log4javascript variables and functions. This was written
|
466
|
+
for the purposes of automated testing but could be used by custom extensions to
|
467
|
+
log4javascript.
|
468
|
+
</div>
|
469
|
+
</li>
|
470
|
+
</ul>
|
471
|
+
<p class="linktotop">
|
472
|
+
<a href="#container">Top</a>
|
473
|
+
</p>
|
474
|
+
</div>
|
475
|
+
<div id="levels">
|
476
|
+
<h2>Levels</h2>
|
477
|
+
<p>
|
478
|
+
Levels are available as static properties of the <code>log4javascript.Level</code>
|
479
|
+
object. In ascending order of severity:
|
480
|
+
</p>
|
481
|
+
<ol>
|
482
|
+
<li><code>log4javascript.Level.ALL</code></li>
|
483
|
+
<li><code>log4javascript.Level.TRACE</code></li>
|
484
|
+
<li><code>log4javascript.Level.DEBUG</code></li>
|
485
|
+
<li><code>log4javascript.Level.INFO</code></li>
|
486
|
+
<li><code>log4javascript.Level.WARN</code></li>
|
487
|
+
<li><code>log4javascript.Level.ERROR</code></li>
|
488
|
+
<li><code>log4javascript.Level.FATAL</code></li>
|
489
|
+
<li><code>log4javascript.Level.OFF</code></li>
|
490
|
+
</ol>
|
491
|
+
<p class="linktotop">
|
492
|
+
<a href="#container">Top</a>
|
493
|
+
</p>
|
494
|
+
</div>
|
495
|
+
<div id="loggers">
|
496
|
+
<h2>Loggers</h2>
|
497
|
+
<p>
|
498
|
+
It is possible to have multiple loggers in log4javascript. For example, you
|
499
|
+
may wish to have a logger for debugging purposes that logs messages to a
|
500
|
+
pop-up window and a separate logger that reports any client-side application
|
501
|
+
errors to the server via Ajax.
|
502
|
+
</p>
|
503
|
+
<div id="loggerhierarchy">
|
504
|
+
<h3>Logger hierarchy and appender additivity</h3>
|
505
|
+
<p>
|
506
|
+
From version 1.4, log4javascript has hierarchical loggers, implemented in the same way
|
507
|
+
as log4j. In summary, you specify a logger's parent logger by means of a dot between the
|
508
|
+
parent logger name and the child logger name. Therefore the logger <code>tim.app.security</code>
|
509
|
+
inherits from <code>tim.app</code>, which in turn inherits from <code>tim</code> which,
|
510
|
+
finally, inherits from the root logger.
|
511
|
+
</p>
|
512
|
+
<p>
|
513
|
+
What inheritance means for a logger is that in the absence of a threshold level set
|
514
|
+
specifically on the logger it inherits its level from its parent; also, a logger inherits
|
515
|
+
all its parent's appenders (this is known as <em>appender additivity</em> in log4j. This
|
516
|
+
behaviour can be enabled or disabled via <code>setAdditivity()</code>. See below). In the
|
517
|
+
above example, if the root logger has a level of <code>DEBUG</code> and one appender,
|
518
|
+
each of the loggers <code>tim.app.security</code>, <code>tim.app</code> and <code>tim</code> would
|
519
|
+
inherit the root level's appender. If, say, <code>tim.app</code>'s threshold level was set
|
520
|
+
to <code>WARN</code>, <code>tim</code>'s effective level would remain at <code>DEBUG</code>
|
521
|
+
(inherited from the root logger) while <code>tim.app.security</code>'s effective level would
|
522
|
+
be <code>WARN</code>, inherited from <code>tim.app</code>. The important thing to note is
|
523
|
+
that appenders accumulate down the logger hierarchy while levels are simply inherited from
|
524
|
+
the nearest ancestor with a threshold level set.
|
525
|
+
</p>
|
526
|
+
<p>
|
527
|
+
For a detailed explanation of the logger hierarchy, see the
|
528
|
+
<a href="http://logging.apache.org/log4j/docs/manual.html" target="_blank"
|
529
|
+
title="Log4j manual (opens in new window)">log4j manual</a>.
|
530
|
+
</p>
|
531
|
+
</div>
|
532
|
+
<p><strong>Notes</strong></p>
|
533
|
+
<ul>
|
534
|
+
<li>
|
535
|
+
It is not possible to instantiate loggers directly. Instead you must use
|
536
|
+
one of the methods of the <code>log4javascript</code> object: <code>getLogger</code>,
|
537
|
+
<code>getRootLogger</code>, <code>getDefaultLogger</code> or <code>getNullLogger</code>.
|
538
|
+
</li>
|
539
|
+
</ul>
|
540
|
+
<h4>Logger methods</h4>
|
541
|
+
<ul class="propertieslist">
|
542
|
+
<li class="method">
|
543
|
+
<div class="name">addAppender</div>
|
544
|
+
<div class="methodsignature"><code>void <strong>addAppender</strong>(Appender <em>appender</em>)</code></div>
|
545
|
+
<div class="paramsheading">Parameters:</div>
|
546
|
+
<ul class="params">
|
547
|
+
<li class="param">
|
548
|
+
<code class="paramname">appender</code>
|
549
|
+
</li>
|
550
|
+
</ul>
|
551
|
+
<div class="summary">
|
552
|
+
Adds the given appender.
|
553
|
+
</div>
|
554
|
+
</li>
|
555
|
+
<li class="method">
|
556
|
+
<div class="name">removeAppender</div>
|
557
|
+
<div class="methodsignature"><code>void <strong>removeAppender</strong>(Appender <em>appender</em>)</code></div>
|
558
|
+
<div class="paramsheading">Parameters:</div>
|
559
|
+
<ul class="params">
|
560
|
+
<li class="param">
|
561
|
+
<code class="paramname">appender</code>
|
562
|
+
</li>
|
563
|
+
</ul>
|
564
|
+
<div class="summary">
|
565
|
+
Removes the given appender.
|
566
|
+
</div>
|
567
|
+
</li>
|
568
|
+
<li class="method">
|
569
|
+
<div class="name">removeAllAppenders</div>
|
570
|
+
<div class="methodsignature"><code>void <strong>removeAllAppenders</strong>()</code></div>
|
571
|
+
<div class="summary">
|
572
|
+
Clears all appenders for the current logger.
|
573
|
+
</div>
|
574
|
+
</li>
|
575
|
+
<li class="method">
|
576
|
+
<div class="name">setLevel</div>
|
577
|
+
<div class="methodsignature"><code>void <strong>setLevel</strong>(Level <em>level</em>)</code></div>
|
578
|
+
<div class="paramsheading">Parameters:</div>
|
579
|
+
<ul class="params">
|
580
|
+
<li class="param">
|
581
|
+
<code class="paramname">level</code>
|
582
|
+
</li>
|
583
|
+
</ul>
|
584
|
+
<div class="summary">
|
585
|
+
Sets the level. Log messages of a lower level than <code>level</code> will not be logged.
|
586
|
+
Default value is <code>DEBUG</code>.
|
587
|
+
</div>
|
588
|
+
</li>
|
589
|
+
<li class="method">
|
590
|
+
<div class="name">getLevel</div>
|
591
|
+
<div class="methodsignature"><code>Level <strong>getLevel</strong>()</code></div>
|
592
|
+
<div class="summary">
|
593
|
+
Returns the level explicitly set for this logger or <code>null</code> if none has been set.
|
594
|
+
</div>
|
595
|
+
</li>
|
596
|
+
<li class="method">
|
597
|
+
<div class="name">getEffectiveLevel</div>
|
598
|
+
<div class="methodsignature"><code>Level <strong>getEffectiveLevel</strong>()</code></div>
|
599
|
+
<div class="summary">
|
600
|
+
Returns the level at which the logger is operating. This is either the level explicitly
|
601
|
+
set on the logger or, if no level has been set, the effective level of the logger's parent.
|
602
|
+
</div>
|
603
|
+
</li>
|
604
|
+
<li class="method">
|
605
|
+
<div class="name">setAdditivity</div>
|
606
|
+
<div class="methodsignature"><code>void <strong>setAdditivity</strong>(Boolean <em>additivity</em>)</code></div>
|
607
|
+
<div class="paramsheading">Parameters:</div>
|
608
|
+
<ul class="params">
|
609
|
+
<li class="param">
|
610
|
+
<code class="paramname">additivity</code>
|
611
|
+
</li>
|
612
|
+
</ul>
|
613
|
+
<div class="summary">
|
614
|
+
<p>
|
615
|
+
Sets whether appender additivity is enabled (the default) or disabled. If set to false, this
|
616
|
+
particular logger will not inherit any appenders form its ancestors. Any descendant of this
|
617
|
+
logger, however, will inherit from its ancestors as normal, unless its own additivity is
|
618
|
+
explicitly set to false.
|
619
|
+
</p>
|
620
|
+
<p>
|
621
|
+
Default value is <code>true</code>.
|
622
|
+
</p>
|
623
|
+
</div>
|
624
|
+
</li>
|
625
|
+
<li class="method">
|
626
|
+
<div class="name">getAdditivity</div>
|
627
|
+
<div class="methodsignature"><code>Boolean <strong>getAdditivity</strong>()</code></div>
|
628
|
+
<div class="summary">
|
629
|
+
Returns whether additivity is enabled for this logger.
|
630
|
+
</div>
|
631
|
+
</li>
|
632
|
+
<li class="method">
|
633
|
+
<div class="name">log</div>
|
634
|
+
<div class="methodsignature"><code>void <strong>log</strong>(Level <em>level</em>, Object <em>params</em>)</code></div>
|
635
|
+
<div class="paramsheading">Parameters:</div>
|
636
|
+
<ul class="params">
|
637
|
+
<li class="param">
|
638
|
+
<code class="paramname">level</code>
|
639
|
+
</li>
|
640
|
+
<li class="param">
|
641
|
+
<code class="paramname">params</code>
|
642
|
+
</li>
|
643
|
+
</ul>
|
644
|
+
<div class="summary">
|
645
|
+
Generic logging method used by wrapper methods such as <code>debug</code>,
|
646
|
+
<code>error</code> etc.
|
647
|
+
</div>
|
648
|
+
<p><strong>Notes</strong></p>
|
649
|
+
<ul>
|
650
|
+
<li>
|
651
|
+
The signature of this method has changed in 1.4.
|
652
|
+
</li>
|
653
|
+
</ul>
|
654
|
+
</li>
|
655
|
+
<li class="method">
|
656
|
+
<div class="name">trace</div>
|
657
|
+
<div class="methodsignature"><code>void <strong>trace</strong>(Object <em>message1</em>[, Object <em>message2</em>, ... ][, Error <em>exception</em>])</code></div>
|
658
|
+
<div class="paramsheading">Parameters:</div>
|
659
|
+
<ul class="params">
|
660
|
+
<li class="param">
|
661
|
+
<code class="paramname">message1[, message2...]</code>
|
662
|
+
</li>
|
663
|
+
<li class="param">
|
664
|
+
<code class="paramname">exception</code>
|
665
|
+
[<em>optional</em>]
|
666
|
+
</li>
|
667
|
+
</ul>
|
668
|
+
<div class="summary">
|
669
|
+
Logs one or more messages and optionally an error at level <code>TRACE</code>.
|
670
|
+
</div>
|
671
|
+
<p><strong>Notes</strong></p>
|
672
|
+
<ul>
|
673
|
+
<li>
|
674
|
+
Logging of multiple messages in one call is new in 1.4.
|
675
|
+
</li>
|
676
|
+
</ul>
|
677
|
+
</li>
|
678
|
+
<li class="method">
|
679
|
+
<div class="name">debug</div>
|
680
|
+
<div class="methodsignature"><code>void <strong>debug</strong>(Object <em>message1</em>[, Object <em>message2</em>, ... ][, Error <em>exception</em>])</code></div>
|
681
|
+
<div class="paramsheading">Parameters:</div>
|
682
|
+
<ul class="params">
|
683
|
+
<li class="param">
|
684
|
+
<code class="paramname">message1[, message2...]</code>
|
685
|
+
</li>
|
686
|
+
<li class="param">
|
687
|
+
<code class="paramname">exception</code>
|
688
|
+
[<em>optional</em>]
|
689
|
+
</li>
|
690
|
+
</ul>
|
691
|
+
<div class="summary">
|
692
|
+
Logs one or more messages and optionally an error at level <code>DEBUG</code>.
|
693
|
+
</div>
|
694
|
+
<p><strong>Notes</strong></p>
|
695
|
+
<ul>
|
696
|
+
<li>
|
697
|
+
Logging of multiple messages in one call is new in 1.4.
|
698
|
+
</li>
|
699
|
+
</ul>
|
700
|
+
</li>
|
701
|
+
<li class="method">
|
702
|
+
<div class="name">info</div>
|
703
|
+
<div class="methodsignature"><code>void <strong>info</strong>(Object <em>message1</em>[, Object <em>message2</em>, ... ][, Error <em>exception</em>])</code></div>
|
704
|
+
<div class="paramsheading">Parameters:</div>
|
705
|
+
<ul class="params">
|
706
|
+
<li class="param">
|
707
|
+
<code class="paramname">message1[, message2...]</code>
|
708
|
+
</li>
|
709
|
+
<li class="param">
|
710
|
+
<code class="paramname">exception</code>
|
711
|
+
[<em>optional</em>]
|
712
|
+
</li>
|
713
|
+
</ul>
|
714
|
+
<div class="summary">
|
715
|
+
Logs one or more messages and optionally an error at level <code>INFO</code>.
|
716
|
+
</div>
|
717
|
+
<p><strong>Notes</strong></p>
|
718
|
+
<ul>
|
719
|
+
<li>
|
720
|
+
Logging of multiple messages in one call is new in 1.4.
|
721
|
+
</li>
|
722
|
+
</ul>
|
723
|
+
</li>
|
724
|
+
<li class="method">
|
725
|
+
<div class="name">warn</div>
|
726
|
+
<div class="methodsignature"><code>void <strong>warn</strong>(Object <em>message1</em>[, Object <em>message2</em>, ... ][, Error <em>exception</em>])</code></div>
|
727
|
+
<div class="paramsheading">Parameters:</div>
|
728
|
+
<ul class="params">
|
729
|
+
<li class="param">
|
730
|
+
<code class="paramname">message1[, message2...]</code>
|
731
|
+
</li>
|
732
|
+
<li class="param">
|
733
|
+
<code class="paramname">exception</code>
|
734
|
+
[<em>optional</em>]
|
735
|
+
</li>
|
736
|
+
</ul>
|
737
|
+
<div class="summary">
|
738
|
+
Logs one or more messages and optionally an error at level <code>WARN</code>.
|
739
|
+
</div>
|
740
|
+
<p><strong>Notes</strong></p>
|
741
|
+
<ul>
|
742
|
+
<li>
|
743
|
+
Logging of multiple messages in one call is new in 1.4.
|
744
|
+
</li>
|
745
|
+
</ul>
|
746
|
+
</li>
|
747
|
+
<li class="method">
|
748
|
+
<div class="name">error</div>
|
749
|
+
<div class="methodsignature"><code>void <strong>error</strong>(Object <em>message1</em>[, Object <em>message2</em>, ... ][, Error <em>exception</em>])</code></div>
|
750
|
+
<div class="paramsheading">Parameters:</div>
|
751
|
+
<ul class="params">
|
752
|
+
<li class="param">
|
753
|
+
<code class="paramname">message1[, message2...]</code>
|
754
|
+
</li>
|
755
|
+
<li class="param">
|
756
|
+
<code class="paramname">exception</code>
|
757
|
+
[<em>optional</em>]
|
758
|
+
</li>
|
759
|
+
</ul>
|
760
|
+
<div class="summary">
|
761
|
+
Logs one or more messages and optionally an error at level <code>ERROR</code>.
|
762
|
+
</div>
|
763
|
+
<p><strong>Notes</strong></p>
|
764
|
+
<ul>
|
765
|
+
<li>
|
766
|
+
Logging of multiple messages in one call is new in 1.4.
|
767
|
+
</li>
|
768
|
+
</ul>
|
769
|
+
</li>
|
770
|
+
<li class="method">
|
771
|
+
<div class="name">fatal</div>
|
772
|
+
<div class="methodsignature"><code>void <strong>fatal</strong>(Object <em>message1</em>[, Object <em>message2</em>, ... ][, Error <em>exception</em>])</code></div>
|
773
|
+
<div class="paramsheading">Parameters:</div>
|
774
|
+
<ul class="params">
|
775
|
+
<li class="param">
|
776
|
+
<code class="paramname">message1[, message2...]</code>
|
777
|
+
</li>
|
778
|
+
<li class="param">
|
779
|
+
<code class="paramname">exception</code>
|
780
|
+
[<em>optional</em>]
|
781
|
+
</li>
|
782
|
+
</ul>
|
783
|
+
<div class="summary">
|
784
|
+
Logs one or more messages and optionally an error at level <code>FATAL</code>.
|
785
|
+
</div>
|
786
|
+
<p><strong>Notes</strong></p>
|
787
|
+
<ul>
|
788
|
+
<li>
|
789
|
+
Logging of multiple messages in one call is new in 1.4.
|
790
|
+
</li>
|
791
|
+
</ul>
|
792
|
+
</li>
|
793
|
+
<li class="method">
|
794
|
+
<div class="name">isEnabledFor</div>
|
795
|
+
<div class="methodsignature"><code>Boolean <strong>isEnabledFor</strong>(Level <em>level</em>, Error <em>exception</em>)</code></div>
|
796
|
+
<div class="paramsheading">Parameters:</div>
|
797
|
+
<ul class="params">
|
798
|
+
<li class="param">
|
799
|
+
<code class="paramname">level</code>
|
800
|
+
</li>
|
801
|
+
</ul>
|
802
|
+
<div class="summary">
|
803
|
+
Returns whether the logger is enabled for the specified level.
|
804
|
+
</div>
|
805
|
+
</li>
|
806
|
+
<li class="method">
|
807
|
+
<div class="name">isTraceEnabled</div>
|
808
|
+
<div class="methodsignature"><code>Boolean <strong>isTraceEnabled</strong>()</code></div>
|
809
|
+
<div class="summary">
|
810
|
+
Returns whether the logger is enabled for <code>TRACE</code> messages.
|
811
|
+
</div>
|
812
|
+
</li>
|
813
|
+
<li class="method">
|
814
|
+
<div class="name">isDebugEnabled</div>
|
815
|
+
<div class="methodsignature"><code>Boolean <strong>isDebugEnabled</strong>()</code></div>
|
816
|
+
<div class="summary">
|
817
|
+
Returns whether the logger is enabled for <code>DEBUG</code> messages.
|
818
|
+
</div>
|
819
|
+
</li>
|
820
|
+
<li class="method">
|
821
|
+
<div class="name">isInfoEnabled</div>
|
822
|
+
<div class="methodsignature"><code>Boolean <strong>isInfoEnabled</strong>()</code></div>
|
823
|
+
<div class="summary">
|
824
|
+
Returns whether the logger is enabled for <code>INFO</code> messages.
|
825
|
+
</div>
|
826
|
+
</li>
|
827
|
+
<li class="method">
|
828
|
+
<div class="name">isWarnEnabled</div>
|
829
|
+
<div class="methodsignature"><code>Boolean <strong>isWarnEnabled</strong>()</code></div>
|
830
|
+
<div class="summary">
|
831
|
+
Returns whether the logger is enabled for <code>WARN</code> messages.
|
832
|
+
</div>
|
833
|
+
</li>
|
834
|
+
<li class="method">
|
835
|
+
<div class="name">isErrorEnabled</div>
|
836
|
+
<div class="methodsignature"><code>Boolean <strong>isErrorEnabled</strong>()</code></div>
|
837
|
+
<div class="summary">
|
838
|
+
Returns whether the logger is enabled for <code>ERROR</code> messages.
|
839
|
+
</div>
|
840
|
+
</li>
|
841
|
+
<li class="method">
|
842
|
+
<div class="name">isFatalEnabled</div>
|
843
|
+
<div class="methodsignature"><code>Boolean <strong>isFatalEnabled</strong>()</code></div>
|
844
|
+
<div class="summary">
|
845
|
+
Returns whether the logger is enabled for <code>FATAL</code> messages.
|
846
|
+
</div>
|
847
|
+
</li>
|
848
|
+
<li class="method">
|
849
|
+
<div class="name">group</div>
|
850
|
+
<div class="methodsignature"><code>void <strong>group</strong>(String <em>name</em>, Boolean <em>initiallyExpanded</em>)</code></div>
|
851
|
+
<div class="paramsheading">Parameters:</div>
|
852
|
+
<ul class="params">
|
853
|
+
<li class="param">
|
854
|
+
<code class="paramname">name</code>
|
855
|
+
</li>
|
856
|
+
<li class="param">
|
857
|
+
<code class="paramname">initiallyExpanded</code>
|
858
|
+
[<em>optional</em>]
|
859
|
+
</li>
|
860
|
+
</ul>
|
861
|
+
<div class="summary">
|
862
|
+
Starts a new group of log messages. In appenders that support grouping (currently
|
863
|
+
<code><a href="#popupappender">PopUpAppender</a></code> and
|
864
|
+
<code><a href="#inpageappender">InPageAppender</a></code>), a group appears as an expandable
|
865
|
+
section in the console, labelled with the <code>name</code> specified.
|
866
|
+
Specifying <code>initiallyExpanded</code> determines whether the
|
867
|
+
group starts off expanded (the default is <code>true</code>). Groups may be nested.
|
868
|
+
</div>
|
869
|
+
</li>
|
870
|
+
<li class="method">
|
871
|
+
<div class="name">groupEnd</div>
|
872
|
+
<div class="methodsignature"><code>void <strong>groupEnd</strong>()</code></div>
|
873
|
+
<div class="summary">
|
874
|
+
Ends the current group. If there is no group then this function has no effect.
|
875
|
+
</div>
|
876
|
+
</li>
|
877
|
+
<li class="method">
|
878
|
+
<div class="name">time</div>
|
879
|
+
<div class="methodsignature"><code>void <strong>time</strong>(String <em>name</em>, Level <em>level</em>)</code></div>
|
880
|
+
<div class="paramsheading">Parameters:</div>
|
881
|
+
<ul class="params">
|
882
|
+
<li class="param">
|
883
|
+
<code class="paramname">name</code>
|
884
|
+
</li>
|
885
|
+
<li class="param">
|
886
|
+
<code class="paramname">level</code>
|
887
|
+
[<em>optional</em>]
|
888
|
+
</li>
|
889
|
+
</ul>
|
890
|
+
<div class="summary">
|
891
|
+
Starts a timer with name <code>name</code>. When the timer is ended with a
|
892
|
+
call to <code>timeEnd</code> using the same name, the amount of time that
|
893
|
+
has elapsed in milliseconds since the timer was started is logged at level
|
894
|
+
<code>level</code>. If not level is supplied, the level defaults to <code>INFO</code>.
|
895
|
+
</div>
|
896
|
+
</li>
|
897
|
+
<li class="method">
|
898
|
+
<div class="name">timeEnd</div>
|
899
|
+
<div class="methodsignature"><code>void <strong>timeEnd</strong>(String <em>name</em>)</code></div>
|
900
|
+
<div class="paramsheading">Parameters:</div>
|
901
|
+
<ul class="params">
|
902
|
+
<li class="param">
|
903
|
+
<code class="paramname">name</code>
|
904
|
+
</li>
|
905
|
+
</ul>
|
906
|
+
<div class="summary">
|
907
|
+
Ends the timer with name <code>name</code> and logs the time elapsed.
|
908
|
+
</div>
|
909
|
+
</li>
|
910
|
+
<li class="method">
|
911
|
+
<div class="name">assert</div>
|
912
|
+
<div class="methodsignature"><code>void <strong>assert</strong>(Object <em>expr</em>)</code></div>
|
913
|
+
<div class="paramsheading">Parameters:</div>
|
914
|
+
<ul class="params">
|
915
|
+
<li class="param">
|
916
|
+
<code class="paramname">expr</code>
|
917
|
+
</li>
|
918
|
+
</ul>
|
919
|
+
<div class="summary">
|
920
|
+
Asserts the given expression is <code>true</code> or evaluates to <code>true</code>.
|
921
|
+
If so, nothing is logged. If not, an error is logged at the <code>ERROR</code> level.
|
922
|
+
</div>
|
923
|
+
</li>
|
924
|
+
</ul>
|
925
|
+
<p class="linktotop">
|
926
|
+
<a href="#container">Top</a>
|
927
|
+
</p>
|
928
|
+
</div>
|
929
|
+
<div id="appenders">
|
930
|
+
<h2>Appenders</h2>
|
931
|
+
<div id="appender">
|
932
|
+
<h3>Appender</h3>
|
933
|
+
<p>
|
934
|
+
There are methods common to all appenders, as listed below.
|
935
|
+
</p>
|
936
|
+
<h4>Methods</h4>
|
937
|
+
<ul class="propertieslist">
|
938
|
+
<li class="method">
|
939
|
+
<div class="name">doAppend</div>
|
940
|
+
<div class="methodsignature"><code>void <strong>doAppend</strong>(LoggingEvent <em>loggingEvent</em>)</code></div>
|
941
|
+
<div class="paramsheading">Parameters:</div>
|
942
|
+
<ul class="params">
|
943
|
+
<li class="param">
|
944
|
+
<code class="paramname">loggingEvent</code>
|
945
|
+
</li>
|
946
|
+
</ul>
|
947
|
+
<div class="summary">
|
948
|
+
<p>
|
949
|
+
Checks the logging event's level is at least as severe as the appender's
|
950
|
+
threshold and calls the appender's <code>append</code> method if so.
|
951
|
+
</p>
|
952
|
+
<p>
|
953
|
+
This method should not in general be used directly or overridden.
|
954
|
+
</p>
|
955
|
+
</div>
|
956
|
+
</li>
|
957
|
+
<li class="method">
|
958
|
+
<div class="name">append</div>
|
959
|
+
<div class="methodsignature"><code>void <strong>append</strong>(LoggingEvent <em>loggingEvent</em>)</code></div>
|
960
|
+
<div class="paramsheading">Parameters:</div>
|
961
|
+
<ul class="params">
|
962
|
+
<li class="param">
|
963
|
+
<code class="paramname">loggingEvent</code>
|
964
|
+
</li>
|
965
|
+
</ul>
|
966
|
+
<div class="summary">
|
967
|
+
Appender-specific method to append a log message. Every appender object should implement
|
968
|
+
this method.
|
969
|
+
</div>
|
970
|
+
</li>
|
971
|
+
<li class="method">
|
972
|
+
<div class="name">setLayout</div>
|
973
|
+
<div class="methodsignature"><code>void <strong>setLayout</strong>(Layout <em>layout</em>)</code></div>
|
974
|
+
<div class="paramsheading">Parameters:</div>
|
975
|
+
<ul class="params">
|
976
|
+
<li class="param">
|
977
|
+
<code class="paramname">layout</code>
|
978
|
+
</li>
|
979
|
+
</ul>
|
980
|
+
<div class="summary">
|
981
|
+
Sets the appender's layout.
|
982
|
+
</div>
|
983
|
+
</li>
|
984
|
+
<li class="method">
|
985
|
+
<div class="name">getLayout</div>
|
986
|
+
<div class="methodsignature"><code>Layout <strong>getLayout</strong>()</code></div>
|
987
|
+
<div class="summary">
|
988
|
+
Returns the appender's layout.
|
989
|
+
</div>
|
990
|
+
</li>
|
991
|
+
<li class="method">
|
992
|
+
<div class="name">setThreshold</div>
|
993
|
+
<div class="methodsignature"><code>void <strong>setThreshold</strong>(Level <em>level</em>)</code></div>
|
994
|
+
<div class="paramsheading">Parameters:</div>
|
995
|
+
<ul class="params">
|
996
|
+
<li class="param">
|
997
|
+
<code class="paramname">level</code>
|
998
|
+
</li>
|
999
|
+
</ul>
|
1000
|
+
<div class="summary">
|
1001
|
+
Sets the appender's threshold. Log messages of level less severe than this
|
1002
|
+
threshold will not be logged.
|
1003
|
+
</div>
|
1004
|
+
</li>
|
1005
|
+
<li class="method">
|
1006
|
+
<div class="name">getThreshold</div>
|
1007
|
+
<div class="methodsignature"><code>Level <strong>getThreshold</strong>()</code></div>
|
1008
|
+
<div class="summary">
|
1009
|
+
Returns the appender's threshold.
|
1010
|
+
</div>
|
1011
|
+
</li>
|
1012
|
+
<li class="method">
|
1013
|
+
<div class="name">toString</div>
|
1014
|
+
<div class="methodsignature"><code>string <strong>toString</strong>()</code></div>
|
1015
|
+
<div class="summary">
|
1016
|
+
Returns a string representation of the appender. Every appender object should implement
|
1017
|
+
this method.
|
1018
|
+
</div>
|
1019
|
+
</li>
|
1020
|
+
</ul>
|
1021
|
+
<p class="linktotop">
|
1022
|
+
<a href="#container">Top</a>
|
1023
|
+
</p>
|
1024
|
+
</div>
|
1025
|
+
<div id="alertappender">
|
1026
|
+
<h3>AlertAppender</h3>
|
1027
|
+
<p class="editions">Editions: <strong>Standard</strong></p>
|
1028
|
+
<p>
|
1029
|
+
Displays a log message as a JavaScript alert.
|
1030
|
+
</p>
|
1031
|
+
<h4>Constructor</h4>
|
1032
|
+
<ul class="propertieslist">
|
1033
|
+
<li class="method">
|
1034
|
+
<div class="name">AlertAppender</div>
|
1035
|
+
<div class="methodsignature"><code><strong>AlertAppender</strong>()</code></div>
|
1036
|
+
</li>
|
1037
|
+
</ul>
|
1038
|
+
<p class="linktotop">
|
1039
|
+
<a href="#container">Top</a>
|
1040
|
+
</p>
|
1041
|
+
</div>
|
1042
|
+
<div id="ajaxappender">
|
1043
|
+
<h3>AjaxAppender</h3>
|
1044
|
+
<p class="editions">Editions: <strong>Standard, Production</strong></p>
|
1045
|
+
<p>
|
1046
|
+
A flexible appender that asynchronously sends log messages to a server via HTTP.
|
1047
|
+
</p>
|
1048
|
+
<p>
|
1049
|
+
The default configuration is to send each log message as a separate HTTP post
|
1050
|
+
request to the server using an <code><a href="#httppostdatalayout">HttpPostDataLayout</a></code>,
|
1051
|
+
without waiting for a response before sending any subsequent requests. However,
|
1052
|
+
an <code>AjaxAppender</code> may be configured to do any one of or combinations of the following:
|
1053
|
+
</p>
|
1054
|
+
<ul>
|
1055
|
+
<li>
|
1056
|
+
send log messages in batches (if the selected layout supports it - particularly suited
|
1057
|
+
to <code>AjaxAppender</code> are <code><a href="#jsonlayout">JsonLayout</a></code> and
|
1058
|
+
<code><a href="#xmllayout">XmlLayout</a></code>, both of which allow batching);
|
1059
|
+
</li>
|
1060
|
+
<li>
|
1061
|
+
wait for a response from a previous request before sending the next log message / batch
|
1062
|
+
of messages;
|
1063
|
+
</li>
|
1064
|
+
<li>
|
1065
|
+
send all queued log messages at timed intervals.
|
1066
|
+
</li>
|
1067
|
+
</ul>
|
1068
|
+
<p><strong>Notes</strong></p>
|
1069
|
+
<ul>
|
1070
|
+
<li>
|
1071
|
+
AjaxAppender relies on the <code>XMLHttpRequest</code> object. It also requires
|
1072
|
+
the presence of correctly implemented <code>setRequestHeader</code> method on
|
1073
|
+
this object, which rules out Opera prior to version 8.01. If your browser does not
|
1074
|
+
support the necessary objects then one alert will display to explain why it
|
1075
|
+
doesn't work, after which the appender will silently switch off.
|
1076
|
+
</li>
|
1077
|
+
<li>
|
1078
|
+
In AjaxAppender only, <code>setLayout</code> may not be called after the first
|
1079
|
+
message has been logged.
|
1080
|
+
</li>
|
1081
|
+
<li>
|
1082
|
+
The default layout is <code><a href="#httppostdatalayout">HttpPostDataLayout</a></code>.
|
1083
|
+
</li>
|
1084
|
+
<li>
|
1085
|
+
<p>
|
1086
|
+
From version 1.4, log message data is always sent as one or more name/value pairs.
|
1087
|
+
In the case of <code><a href="#httppostdatalayout">HttpPostDataLayout</a></code>,
|
1088
|
+
data is sent the same as in previous versions. For other layouts such as
|
1089
|
+
<code><a href="#jsonlayout">JsonLayout</a></code> and
|
1090
|
+
<code><a href="#xmllayout">XmlLayout</a></code>, the formatted log message is posted
|
1091
|
+
as the value of a parameter called <code>data</code>, though this may be changed via
|
1092
|
+
<code>setPostVarName</code>.
|
1093
|
+
</p>
|
1094
|
+
<p>
|
1095
|
+
From version 1.4.5, it is possible to override this behaviour so that logging data
|
1096
|
+
is sent as the request payload rather than as a posted form variable. This is done
|
1097
|
+
by setting the <code>Content-Type</code> header sent with each Ajax request
|
1098
|
+
explicitly. For example, if using a
|
1099
|
+
<code><a href="#jsonlayout">JsonLayout</a></code>:
|
1100
|
+
</p>
|
1101
|
+
<pre>ajaxApender.addHeader("Content-Type", "application/json");</pre>
|
1102
|
+
</li>
|
1103
|
+
<li>
|
1104
|
+
From version 1.4, log message timestamps are sent as standard JavaScript times, i.e.
|
1105
|
+
the number of milliseconds since 00:00:00 UTC on January 1, 1970.
|
1106
|
+
</li>
|
1107
|
+
<li>
|
1108
|
+
<p>
|
1109
|
+
Also from version 1.4, any outstanding log messages may optionally be sent when the
|
1110
|
+
main page unloads (i.e. user follows a link, closes the window or refreshes the
|
1111
|
+
page). This behaviour may be enabled using <code>setSendAllOnUnload</code>; see
|
1112
|
+
below.
|
1113
|
+
</p>
|
1114
|
+
<p>
|
1115
|
+
This behaviour is dependent on <code>window.onbeforeunload</code>; unfortunately,
|
1116
|
+
Opera does not always raise this event, so this feature does not work reliably in
|
1117
|
+
Opera.
|
1118
|
+
</p>
|
1119
|
+
</li>
|
1120
|
+
<li>
|
1121
|
+
From version 1.4.8, AjaxAppender supports the sending of cookies in CORS requests via
|
1122
|
+
the new <code>withCredentials</code> constructor parameter.
|
1123
|
+
</li>
|
1124
|
+
</ul>
|
1125
|
+
<h4>Constructor</h4>
|
1126
|
+
<ul class="propertieslist">
|
1127
|
+
<li class="method">
|
1128
|
+
<div class="name">AjaxAppender</div>
|
1129
|
+
<div class="methodsignature">
|
1130
|
+
<code><strong>AjaxAppender</strong>(String <em>url</em>[, Boolean <em>withCredentials</em>])</code>
|
1131
|
+
</div>
|
1132
|
+
<div class="paramsheading">Parameters:</div>
|
1133
|
+
<ul class="params">
|
1134
|
+
<li class="param">
|
1135
|
+
<code class="paramname">url</code>
|
1136
|
+
<div>
|
1137
|
+
The URL to which log messages should be sent. Note that this is subject
|
1138
|
+
to the usual Ajax restrictions: the URL should be in the same domain as that
|
1139
|
+
of the page making the request.
|
1140
|
+
</div>
|
1141
|
+
</li>
|
1142
|
+
<li class="param">
|
1143
|
+
<code class="paramname">withCredentials</code>
|
1144
|
+
<p>
|
1145
|
+
<strong>Since: 1.4.8</strong>
|
1146
|
+
</p>
|
1147
|
+
<div>
|
1148
|
+
Specifies whether cookies should be sent with each request.
|
1149
|
+
</div>
|
1150
|
+
</li>
|
1151
|
+
</ul>
|
1152
|
+
</li>
|
1153
|
+
</ul>
|
1154
|
+
<h4>Methods</h4>
|
1155
|
+
<ul class="propertieslist">
|
1156
|
+
<li class="method">
|
1157
|
+
<div class="name">setSendAllOnUnload</div>
|
1158
|
+
<div class="methodsignature"><code>void <strong>setSendAllOnUnload</strong>(Boolean <em>sendAllOnUnload</em>)</code></div>
|
1159
|
+
<div class="summary">
|
1160
|
+
<p>
|
1161
|
+
[<em>not available after first message logged</em>]
|
1162
|
+
</p>
|
1163
|
+
<p>
|
1164
|
+
Whether to send all remaining unsent log messages to the server when the page
|
1165
|
+
unloads.
|
1166
|
+
</p>
|
1167
|
+
<p>
|
1168
|
+
Since version 1.4.3, the default value is <code>false</code>. Previously the
|
1169
|
+
default was <code>true</code>.
|
1170
|
+
</p>
|
1171
|
+
<p><strong>Notes</strong></p>
|
1172
|
+
<ul>
|
1173
|
+
<li>
|
1174
|
+
This feature was found not to work prior to version 1.4.3 in WebKit
|
1175
|
+
browsers (e.g. Google Chrome, Safari). As a result, a workaround was
|
1176
|
+
implemented in 1.4.3 which has the unfortunate side effect of popping up a
|
1177
|
+
confirmation dialog to the user if there are any log messages to send when
|
1178
|
+
the page unloads. As a result, this feature is now obtrusive for the user
|
1179
|
+
and is therefore disabled by default.
|
1180
|
+
</li>
|
1181
|
+
<li>
|
1182
|
+
This feature does not work in any version of Opera.
|
1183
|
+
</li>
|
1184
|
+
</ul>
|
1185
|
+
</div>
|
1186
|
+
</li>
|
1187
|
+
<li class="method">
|
1188
|
+
<div class="name">isSendAllOnUnload</div>
|
1189
|
+
<div class="methodsignature"><code>Boolean <strong>isSendAllOnUnload</strong>()</code></div>
|
1190
|
+
<div class="summary">
|
1191
|
+
Returns whether all remaining unsent log messages are sent to the server when the page unloads.
|
1192
|
+
</div>
|
1193
|
+
</li>
|
1194
|
+
<li class="method">
|
1195
|
+
<div class="name">setPostVarName</div>
|
1196
|
+
<div class="methodsignature"><code>void <strong>setPostVarName</strong>(String <em>postVarName</em>)</code></div>
|
1197
|
+
<div class="summary">
|
1198
|
+
<p>
|
1199
|
+
[<em>not available after first message logged</em>]
|
1200
|
+
</p>
|
1201
|
+
<p>
|
1202
|
+
Sets the post variable name whose value will the formatted log message(s) for
|
1203
|
+
each request.
|
1204
|
+
</p>
|
1205
|
+
<p>
|
1206
|
+
Default value is <code>data</code>.
|
1207
|
+
</p>
|
1208
|
+
<p><strong>Notes</strong></p>
|
1209
|
+
<ul>
|
1210
|
+
<li>
|
1211
|
+
This has no effect if the current layout is an
|
1212
|
+
<code><a href="#httppostdatalayout">HttpPostDataLayout</a></code>.
|
1213
|
+
</li>
|
1214
|
+
</ul>
|
1215
|
+
</div>
|
1216
|
+
</li>
|
1217
|
+
<li class="method">
|
1218
|
+
<div class="name">getPostVarName</div>
|
1219
|
+
<div class="methodsignature"><code>String <strong>getPostVarName</strong>()</code></div>
|
1220
|
+
<div class="summary">
|
1221
|
+
Returns the post variable name whose value will the formatted log message(s) for
|
1222
|
+
each request.
|
1223
|
+
</div>
|
1224
|
+
</li>
|
1225
|
+
<li class="method">
|
1226
|
+
<div class="name">setTimed</div>
|
1227
|
+
<div class="methodsignature"><code>void <strong>setTimed</strong>(Boolean <em>timed</em>)</code></div>
|
1228
|
+
<div class="summary">
|
1229
|
+
<p>
|
1230
|
+
[<em>not available after first message logged</em>]
|
1231
|
+
</p>
|
1232
|
+
<p>
|
1233
|
+
Whether to send log messages to the server at regular, timed intervals.
|
1234
|
+
</p>
|
1235
|
+
<p>
|
1236
|
+
Default value is <code>false</code>.
|
1237
|
+
</p>
|
1238
|
+
</div>
|
1239
|
+
</li>
|
1240
|
+
<li class="method">
|
1241
|
+
<div class="name">isTimed</div>
|
1242
|
+
<div class="methodsignature"><code>Boolean <strong>isTimed</strong>()</code></div>
|
1243
|
+
<div class="summary">
|
1244
|
+
Returns whether log messages are sent to the server at regular, timed intervals.
|
1245
|
+
</div>
|
1246
|
+
</li>
|
1247
|
+
<li class="method">
|
1248
|
+
<div class="name">setWaitForResponse</div>
|
1249
|
+
<div class="methodsignature"><code>void <strong>setWaitForResponse</strong>(Boolean <em>waitForResponse</em>)</code></div>
|
1250
|
+
<div class="summary">
|
1251
|
+
<p>
|
1252
|
+
[<em>not available after first message logged</em>]
|
1253
|
+
</p>
|
1254
|
+
<p>
|
1255
|
+
Sets whether to wait for a response from a previous HTTP request from this
|
1256
|
+
appender before sending the next log message / batch of messages.
|
1257
|
+
</p>
|
1258
|
+
<p>
|
1259
|
+
Default value is <code>false</code>.
|
1260
|
+
</p>
|
1261
|
+
</div>
|
1262
|
+
</li>
|
1263
|
+
<li class="method">
|
1264
|
+
<div class="name">isWaitForResponse</div>
|
1265
|
+
<div class="methodsignature"><code>Boolean <strong>isWaitForResponse</strong>()</code></div>
|
1266
|
+
<div class="summary">
|
1267
|
+
Returns whether the appender waits for a response from a previous HTTP request from this
|
1268
|
+
appender before sending the next log message / batch of messages.
|
1269
|
+
</div>
|
1270
|
+
</li>
|
1271
|
+
<li class="method">
|
1272
|
+
<div class="name">setBatchSize</div>
|
1273
|
+
<div class="methodsignature"><code>void <strong>setBatchSize</strong>(Number <em>batchSize</em>)</code></div>
|
1274
|
+
<div class="summary">
|
1275
|
+
<p>
|
1276
|
+
[<em>not available after first message logged</em>]
|
1277
|
+
</p>
|
1278
|
+
<p>
|
1279
|
+
Sets the number of log messages to send in each request. If not specified,
|
1280
|
+
defaults to <code>1</code>.
|
1281
|
+
</p>
|
1282
|
+
<p><strong>Notes</strong></p>
|
1283
|
+
<ul>
|
1284
|
+
<li>
|
1285
|
+
Setting this to a number greater than 1 means that the appender will wait
|
1286
|
+
until it has forwarded that many valid log messages before sending any more.
|
1287
|
+
This also means that if the page unloads for any reason and <code>sendAllOnUnload</code>
|
1288
|
+
is not set to <code>true</code>, any log messages waiting in the queue will not be sent.
|
1289
|
+
</li>
|
1290
|
+
<li>
|
1291
|
+
If batching is used in conjunction with timed sending of log messages,
|
1292
|
+
messages will still be sent in batches of size <code>batchSize</code>,
|
1293
|
+
regardless of how many log messages are queued by the time the timed
|
1294
|
+
sending is invoked. Incomplete batches will not be sent except when the
|
1295
|
+
page unloads, if <code>sendAllOnUnload</code> is set to <code>true</code>.
|
1296
|
+
</li>
|
1297
|
+
</ul>
|
1298
|
+
</div>
|
1299
|
+
</li>
|
1300
|
+
<li class="method">
|
1301
|
+
<div class="name">getBatchSize</div>
|
1302
|
+
<div class="methodsignature"><code>Number <strong>getBatchSize</strong>()</code></div>
|
1303
|
+
<div class="summary">
|
1304
|
+
Returns the number of log messages sent in each request. See above for more details.
|
1305
|
+
</div>
|
1306
|
+
</li>
|
1307
|
+
<li class="method">
|
1308
|
+
<div class="name">setTimerInterval</div>
|
1309
|
+
<div class="methodsignature"><code>void <strong>setTimerInterval</strong>(Number <em>timerInterval</em>)</code></div>
|
1310
|
+
<div class="summary">
|
1311
|
+
<p>
|
1312
|
+
[<em>not available after first message logged</em>]
|
1313
|
+
</p>
|
1314
|
+
<p>
|
1315
|
+
Sets the length of time in milliseconds between each sending of queued log
|
1316
|
+
messages.
|
1317
|
+
</p>
|
1318
|
+
<p><strong>Notes</strong></p>
|
1319
|
+
<ul>
|
1320
|
+
<li>
|
1321
|
+
<code>timerInterval</code> only has an effect in conjunction with
|
1322
|
+
<code>timed</code> (set by <code>setTimed()</code>. If <code>timed</code>
|
1323
|
+
is set to false then <code>timerInterval</code> has no effect.
|
1324
|
+
</li>
|
1325
|
+
<li>
|
1326
|
+
Each time the queue of log messages or batches of messages is cleared,
|
1327
|
+
the countdown to the next sending only starts once the final request
|
1328
|
+
has been sent (and, if <code>waitForResponse</code> is set to <code>true</code>,
|
1329
|
+
the final response received). This means that the actual interval at
|
1330
|
+
which the queue of messages is cleared cannot be fixed.
|
1331
|
+
</li>
|
1332
|
+
</ul>
|
1333
|
+
</div>
|
1334
|
+
</li>
|
1335
|
+
<li class="method">
|
1336
|
+
<div class="name">getTimerInterval</div>
|
1337
|
+
<div class="methodsignature"><code>Number <strong>getTimerInterval</strong>()</code></div>
|
1338
|
+
<div class="summary">
|
1339
|
+
Returns the length of time in milliseconds between each sending of queued log
|
1340
|
+
messages. See above for more details.
|
1341
|
+
</div>
|
1342
|
+
</li>
|
1343
|
+
<li class="method">
|
1344
|
+
<div class="name">setRequestSuccessCallback</div>
|
1345
|
+
<div class="methodsignature"><code>void <strong>setRequestSuccessCallback</strong>(Function <em>requestSuccessCallback</em>)</code></div>
|
1346
|
+
<div class="summary">
|
1347
|
+
<p>
|
1348
|
+
Sets the function that is called whenever a successful request is made, called at the
|
1349
|
+
point at which the response is received. This feature can be used to confirm
|
1350
|
+
whether a request has been successful and act accordingly.
|
1351
|
+
</p>
|
1352
|
+
<p>
|
1353
|
+
A single parameter, <code>xmlHttp</code>, is passed to the callback function.
|
1354
|
+
This is the XMLHttpRequest object that performed the request.
|
1355
|
+
</p>
|
1356
|
+
</div>
|
1357
|
+
</li>
|
1358
|
+
<li class="method">
|
1359
|
+
<div class="name">setFailCallback</div>
|
1360
|
+
<div class="methodsignature"><code>void <strong>setFailCallback</strong>(Function <em>failCallback</em>)</code></div>
|
1361
|
+
<div class="summary">
|
1362
|
+
<p>
|
1363
|
+
Sets the function that is called whenever any kind of failure occurs in the appender,
|
1364
|
+
including browser deficiencies or configuration errors (e.g. supplying a
|
1365
|
+
non-existent URL to the appender). This feature can be used to handle
|
1366
|
+
AjaxAppender-specific errors.
|
1367
|
+
</p>
|
1368
|
+
<p>
|
1369
|
+
A single parameter, <code>message</code>, is passed to the callback function.
|
1370
|
+
This is the error-specific message that caused the failure.
|
1371
|
+
</p>
|
1372
|
+
</div>
|
1373
|
+
</li>
|
1374
|
+
<li class="method">
|
1375
|
+
<div class="name">setSessionId</div>
|
1376
|
+
<div class="methodsignature"><code>void <strong>setSessionId</strong>(String <em>sessionId</em>)</code></div>
|
1377
|
+
<div class="summary">
|
1378
|
+
Sets the session id sent to the server each time a request is made.
|
1379
|
+
</div>
|
1380
|
+
</li>
|
1381
|
+
<li class="method">
|
1382
|
+
<div class="name">getSessionId</div>
|
1383
|
+
<div class="methodsignature"><code>String <strong>getSessionId</strong>()</code></div>
|
1384
|
+
<div class="summary">
|
1385
|
+
Returns the session id sent to the server each time a request is made.
|
1386
|
+
</div>
|
1387
|
+
</li>
|
1388
|
+
<li class="method">
|
1389
|
+
<div class="name">addHeader</div>
|
1390
|
+
<div class="methodsignature"><code>void <strong>addHeader</strong>(String <em>name</em>,
|
1391
|
+
String <em>value</em>)</code></div>
|
1392
|
+
<div class="summary">
|
1393
|
+
<p>
|
1394
|
+
Adds an HTTP header that is sent with each request.
|
1395
|
+
</p>
|
1396
|
+
<p>
|
1397
|
+
<strong>Since: 1.4.3</strong>
|
1398
|
+
</p>
|
1399
|
+
<p>
|
1400
|
+
From 1.4.5, specifying the <code>Content-Type</code> header using this method
|
1401
|
+
will force logging data to be sent as the Ajax request payload rather than as a
|
1402
|
+
posted form field.
|
1403
|
+
</p>
|
1404
|
+
</div>
|
1405
|
+
</li>
|
1406
|
+
<li class="method">
|
1407
|
+
<div class="name">getHeaders</div>
|
1408
|
+
<div class="methodsignature"><code>Array <strong>getHeaders</strong>()</code></div>
|
1409
|
+
<div class="summary">
|
1410
|
+
Returns an array of the additional headers that are sent with each HTTP request.
|
1411
|
+
Each array item is an object with properties <code>name</code> and
|
1412
|
+
<code>value</code>.
|
1413
|
+
<p>
|
1414
|
+
<strong>Since: 1.4.3</strong>
|
1415
|
+
</p>
|
1416
|
+
</div>
|
1417
|
+
</li>
|
1418
|
+
<li class="method">
|
1419
|
+
<div class="name">sendAll</div>
|
1420
|
+
<div class="methodsignature"><code>void <strong>sendAll</strong>()</code></div>
|
1421
|
+
<div class="summary">
|
1422
|
+
Sends all log messages in the queue. If log messages are batched then only completed
|
1423
|
+
batches are sent.
|
1424
|
+
</div>
|
1425
|
+
</li>
|
1426
|
+
</ul>
|
1427
|
+
<p class="linktotop">
|
1428
|
+
<a href="#container">Top</a>
|
1429
|
+
</p>
|
1430
|
+
</div>
|
1431
|
+
<div id="popupappender">
|
1432
|
+
<h3>PopUpAppender</h3>
|
1433
|
+
<p class="editions">Editions: <strong>Standard</strong></p>
|
1434
|
+
<p>
|
1435
|
+
Logs messages to a pop-up console window (note: you will need to disable pop-up
|
1436
|
+
blockers to use it). The pop-up displays a list of all log messages, and has
|
1437
|
+
the following features:
|
1438
|
+
</p>
|
1439
|
+
<ul>
|
1440
|
+
<li>log messages are colour-coded by severity;</li>
|
1441
|
+
<li>log messages are displayed in a monospace font to allow easy readability;</li>
|
1442
|
+
<li>switchable wrap mode to allow wrapping of long lines</li>
|
1443
|
+
<li>all whitespace in log messages is honoured (except in wrap mode);</li>
|
1444
|
+
<li>filters to show and hide messages of a particular level;</li>
|
1445
|
+
<li>
|
1446
|
+
search facility that allows searching of log messages as you type, with the
|
1447
|
+
following features:
|
1448
|
+
<ul>
|
1449
|
+
<li>supports regular expressions;</li>
|
1450
|
+
<li>case sensitive or insensitive matching;</li>
|
1451
|
+
<li>buttons to navigate through all the matches;</li>
|
1452
|
+
<li>switch to highlight all matches;</li>
|
1453
|
+
<li>switch to filter out all log messages that contain no matches;</li>
|
1454
|
+
<li>switch to enable or disable the search;</li>
|
1455
|
+
<li>search is dynamically applied to every log message as it is added to the console.</li>
|
1456
|
+
</ul>
|
1457
|
+
</li>
|
1458
|
+
<li>switch to toggle between logging from the top down and from the bottom up;</li>
|
1459
|
+
<li>switch to turn automatic scrolling when a new message is logged on and off;</li>
|
1460
|
+
<li>switch to turn off all logging to the pop-up (useful if a timer is generating unwanted log messages);</li>
|
1461
|
+
<li>optional configurable limit to the number of log message that are displayed. If
|
1462
|
+
set and this limit is reached, each new log message will cause the oldest one to
|
1463
|
+
be discarded;</li>
|
1464
|
+
<li>grouped log messages. Groups may be nested and each has a button to show or hide the log messages in that group;</li>
|
1465
|
+
<li>clear button to allow user to delete all current log messages.</li>
|
1466
|
+
<li>
|
1467
|
+
command prompt with up/down arrow history. Command line functions may be added
|
1468
|
+
to the appender. Several command line functions are built in:
|
1469
|
+
<ul class="propertieslist">
|
1470
|
+
<li class="method">
|
1471
|
+
<div class="methodsignature"><code><strong>$</strong>(String <em>id</em>)</code></div>
|
1472
|
+
<div class="summary">
|
1473
|
+
Prints a string representation of a single element with the id supplied.
|
1474
|
+
</div>
|
1475
|
+
</li>
|
1476
|
+
<li class="method">
|
1477
|
+
<div class="methodsignature"><code><strong>dir</strong>(Object <em>obj</em>)</code></div>
|
1478
|
+
<div class="summary">
|
1479
|
+
Prints a list of a properties of the object supplied.
|
1480
|
+
</div>
|
1481
|
+
</li>
|
1482
|
+
<li class="method">
|
1483
|
+
<div class="methodsignature"><code><strong>dirxml</strong>(HTMLElement <em>el</em>)</code></div>
|
1484
|
+
<div class="summary">
|
1485
|
+
Prints the XML source code of an HTML or XML element
|
1486
|
+
</div>
|
1487
|
+
</li>
|
1488
|
+
<li class="method">
|
1489
|
+
<div class="methodsignature"><code><strong>cd</strong>(Object <em>win</em>)</code></div>
|
1490
|
+
<div class="summary">
|
1491
|
+
Changes the scope of execution of commands to the named frame or window (either a
|
1492
|
+
window/frame name or a reference to a window object may be supplied).
|
1493
|
+
</div>
|
1494
|
+
</li>
|
1495
|
+
<li class="method">
|
1496
|
+
<div class="methodsignature"><code><strong>clear</strong>()</code></div>
|
1497
|
+
<div class="summary">
|
1498
|
+
Clears the console.
|
1499
|
+
</div>
|
1500
|
+
</li>
|
1501
|
+
<li class="method">
|
1502
|
+
<div class="methodsignature"><code><strong>keys</strong>(Object <em>obj</em>)</code></div>
|
1503
|
+
<div class="summary">
|
1504
|
+
Prints a list of the names of all properties of the object supplied.
|
1505
|
+
</div>
|
1506
|
+
</li>
|
1507
|
+
<li class="method">
|
1508
|
+
<div class="methodsignature"><code><strong>values</strong>(Object <em>obj</em>)</code></div>
|
1509
|
+
<div class="summary">
|
1510
|
+
Prints a list of the values of all properties of the object supplied.
|
1511
|
+
</div>
|
1512
|
+
</li>
|
1513
|
+
<li class="method">
|
1514
|
+
<div class="methodsignature"><code><strong>expansionDepth</strong>(Number <em>depth</em>)</code></div>
|
1515
|
+
<div class="summary">
|
1516
|
+
Sets the number of levels of expansion of objects that are displayed by
|
1517
|
+
the command line. The default value is 1.
|
1518
|
+
</div>
|
1519
|
+
</li>
|
1520
|
+
</ul>
|
1521
|
+
</li>
|
1522
|
+
</ul>
|
1523
|
+
<p><strong>Notes</strong></p>
|
1524
|
+
<ul>
|
1525
|
+
<li>
|
1526
|
+
<p>
|
1527
|
+
The default layout for this appender is <code><a href="#patternlayout">PatternLayout</a></code>
|
1528
|
+
with pattern string
|
1529
|
+
</p>
|
1530
|
+
<p>
|
1531
|
+
<code>%d{HH:mm:ss} %-5p - %m{1}%n</code>
|
1532
|
+
</p>
|
1533
|
+
</li>
|
1534
|
+
</ul>
|
1535
|
+
<h4>Constructor</h4>
|
1536
|
+
<ul class="propertieslist">
|
1537
|
+
<li class="method">
|
1538
|
+
<div class="name">PopUpAppender</div>
|
1539
|
+
<div class="methodsignature">
|
1540
|
+
<code><strong>PopUpAppender</strong>([Boolean <em>lazyInit</em>,
|
1541
|
+
Boolean <em>initiallyMinimized</em>, Boolean <em>useDocumentWrite</em>,
|
1542
|
+
Number <em>width</em>, Number <em>height</em>])</code>
|
1543
|
+
</div>
|
1544
|
+
<div class="paramsheading">Parameters:</div>
|
1545
|
+
<ul class="params">
|
1546
|
+
<li class="param">
|
1547
|
+
<code class="paramname">lazyInit</code>
|
1548
|
+
[<em>optional</em>]
|
1549
|
+
<div>
|
1550
|
+
Set this to <code>true</code> to open the pop-up only when the first log
|
1551
|
+
message reaches the appender. Otherwise, the pop-up window opens as soon as the
|
1552
|
+
appender is created. If not specified, defaults to <code>false</code>.
|
1553
|
+
</div>
|
1554
|
+
</li>
|
1555
|
+
<li class="param">
|
1556
|
+
<code class="paramname">initiallyMinimized</code>
|
1557
|
+
[<em>optional</em>]
|
1558
|
+
<div>
|
1559
|
+
<p>
|
1560
|
+
Whether the console window should start off hidden / minimized.
|
1561
|
+
If not specified, defaults to <code>false</code>.
|
1562
|
+
</p>
|
1563
|
+
</div>
|
1564
|
+
</li>
|
1565
|
+
<li class="param">
|
1566
|
+
<code class="paramname">useDocumentWrite</code>
|
1567
|
+
[<em>optional</em>]
|
1568
|
+
<div>
|
1569
|
+
<p>
|
1570
|
+
Specifies how the console window is created. By default, the console window is
|
1571
|
+
created dynamically using <code>document</code>'s <code>write</code> method. This has the
|
1572
|
+
advantage of keeping all the code in one single JavaScript file. However, if your
|
1573
|
+
page sets <code>document.domain</code> then the browser prevents script access to
|
1574
|
+
a window unless it too has the same value set for <code>document.domain</code>. To
|
1575
|
+
get round this issue, you can set <code>useDocumentWrite</code> to <code>false</code>
|
1576
|
+
and log4javascript will instead use the external HTML file <code>console.html</code>
|
1577
|
+
(or <code>console_uncompressed.html</code> if you're using an uncompressed version of
|
1578
|
+
log4javascript.js), which must be placed in the same directory as your log4javascript.js file.
|
1579
|
+
</p>
|
1580
|
+
<p>
|
1581
|
+
Note that if <code>useDocumentWrite</code> is set to <code>true</code>, the old pop-up
|
1582
|
+
window will always be closed and a new one created whenever the page is refreshed, even
|
1583
|
+
if <code>setUseOldPopUp(true)</code> has been called.
|
1584
|
+
</p>
|
1585
|
+
<p>
|
1586
|
+
In general it's simpler to use the <code>document.write</code> method, so unless your
|
1587
|
+
page needs to set <code>document.domain</code>, <code>useDocumentWrite</code> should
|
1588
|
+
be set to <code>true</code>.
|
1589
|
+
</p>
|
1590
|
+
<p>
|
1591
|
+
If not specified, defaults to <code>true</code>.
|
1592
|
+
</p>
|
1593
|
+
</div>
|
1594
|
+
</li>
|
1595
|
+
<li class="param">
|
1596
|
+
<code class="paramname">width</code>
|
1597
|
+
[<em>optional</em>]
|
1598
|
+
<div>
|
1599
|
+
The outer width in pixels of the pop-up window. If not specified,
|
1600
|
+
defaults to <code>600</code>.
|
1601
|
+
</div>
|
1602
|
+
</li>
|
1603
|
+
<li class="param">
|
1604
|
+
<code class="paramname">height</code>
|
1605
|
+
[<em>optional</em>]
|
1606
|
+
<div>
|
1607
|
+
The outer height in pixels of the pop-up window. If not specified,
|
1608
|
+
defaults to <code>400</code>.
|
1609
|
+
</div>
|
1610
|
+
</li>
|
1611
|
+
</ul>
|
1612
|
+
</li>
|
1613
|
+
</ul>
|
1614
|
+
<h4>Methods</h4>
|
1615
|
+
<ul class="propertieslist">
|
1616
|
+
<li class="method">
|
1617
|
+
<div class="name">isInitiallyMinimized</div>
|
1618
|
+
<div class="methodsignature"><code>Boolean <strong>isInitiallyMinimized</strong>()</code></div>
|
1619
|
+
<div class="summary">
|
1620
|
+
Returns whether the console window starts off hidden / minimized.
|
1621
|
+
</div>
|
1622
|
+
</li>
|
1623
|
+
<li class="method">
|
1624
|
+
<div class="name">setInitiallyMinimized</div>
|
1625
|
+
<div class="methodsignature"><code>void <strong>setInitiallyMinimized</strong>(Boolean <em>initiallyMinimized</em>)</code></div>
|
1626
|
+
<div class="summary">
|
1627
|
+
[<em>not available after initialization</em>]
|
1628
|
+
<br />
|
1629
|
+
Sets whether the console window should start off hidden / minimized.
|
1630
|
+
</div>
|
1631
|
+
</li>
|
1632
|
+
<li class="method">
|
1633
|
+
<div class="name">isFocusPopUp</div>
|
1634
|
+
<div class="methodsignature"><code>Boolean <strong>isFocusPopUp</strong>()</code></div>
|
1635
|
+
<div class="summary">
|
1636
|
+
Returns whether the pop-up window is focussed (i.e. brought it to the front)
|
1637
|
+
when a new log message is added. Default value is <code>false</code>.
|
1638
|
+
</div>
|
1639
|
+
</li>
|
1640
|
+
<li class="method">
|
1641
|
+
<div class="name">setFocusPopUp</div>
|
1642
|
+
<div class="methodsignature"><code>void <strong>setFocusPopUp</strong>(Boolean <em>focusPopUp</em>)</code></div>
|
1643
|
+
<div class="summary">
|
1644
|
+
Sets whether to focus the pop-up window (i.e. bring it to the front)
|
1645
|
+
when a new log message is added.
|
1646
|
+
</div>
|
1647
|
+
</li>
|
1648
|
+
<li class="method">
|
1649
|
+
<div class="name">isUseOldPopUp</div>
|
1650
|
+
<div class="methodsignature"><code>Boolean <strong>isUseOldPopUp</strong>()</code></div>
|
1651
|
+
<div class="summary">
|
1652
|
+
<p>
|
1653
|
+
Returns whether the same pop-up window is used if the main page is
|
1654
|
+
reloaded. If set to <code>true</code>, when the page is reloaded
|
1655
|
+
a line is drawn in the pop-up and subsequent log messages are added
|
1656
|
+
to the same pop-up. Otherwise, a new pop-up window is created that
|
1657
|
+
replaces the original pop-up. If not specified, defaults to
|
1658
|
+
<code>true</code>.
|
1659
|
+
</p>
|
1660
|
+
<p><strong>Notes</strong></p>
|
1661
|
+
<ul>
|
1662
|
+
<li>
|
1663
|
+
In Internet Explorer 5, the browser prevents this from working
|
1664
|
+
properly, so a new pop-up window is always created when the main
|
1665
|
+
page reloads. Also, the original pop-up does not get closed.
|
1666
|
+
</li>
|
1667
|
+
</ul>
|
1668
|
+
</div>
|
1669
|
+
</li>
|
1670
|
+
<li class="method">
|
1671
|
+
<div class="name">setUseOldPopUp</div>
|
1672
|
+
<div class="methodsignature"><code>void <strong>setUseOldPopUp</strong>(Boolean <em>useOldPopUp</em>)</code></div>
|
1673
|
+
<div class="summary">
|
1674
|
+
[<em>not available after initialization</em>]
|
1675
|
+
<br />
|
1676
|
+
Sets whether to use the same pop-up window if the main page is reloaded.
|
1677
|
+
See <code>isUseOldPopUp</code> above for details.
|
1678
|
+
</div>
|
1679
|
+
</li>
|
1680
|
+
<li class="method">
|
1681
|
+
<div class="name">isComplainAboutPopUpBlocking</div>
|
1682
|
+
<div class="methodsignature"><code>Boolean <strong>isComplainAboutPopUpBlocking</strong>()</code></div>
|
1683
|
+
<div class="summary">
|
1684
|
+
Returns whether an alert is shown to the user when the pop-up window
|
1685
|
+
cannot be created as a result of a pop-up blocker. Default value is <code>true</code>.
|
1686
|
+
</div>
|
1687
|
+
</li>
|
1688
|
+
<li class="method">
|
1689
|
+
<div class="name">setComplainAboutPopUpBlocking</div>
|
1690
|
+
<div class="methodsignature"><code>void <strong>setComplainAboutPopUpBlocking</strong>(Boolean <em>complainAboutPopUpBlocking</em>)</code></div>
|
1691
|
+
<div class="summary">
|
1692
|
+
[<em>not available after initialization</em>]
|
1693
|
+
<br />
|
1694
|
+
Sets whether to announce to show an alert to the user when the pop-up window
|
1695
|
+
cannot be created as a result of a pop-up blocker.
|
1696
|
+
</div>
|
1697
|
+
</li>
|
1698
|
+
<li class="method">
|
1699
|
+
<div class="name">isNewestMessageAtTop</div>
|
1700
|
+
<div class="methodsignature"><code>Boolean <strong>isNewestMessageAtTop</strong>()</code></div>
|
1701
|
+
<div class="summary">
|
1702
|
+
Returns whether new log messages are displayed at the top of the pop-up window.
|
1703
|
+
Default value is <code>false</code> (i.e. log messages are appended to the bottom of the window).
|
1704
|
+
</div>
|
1705
|
+
</li>
|
1706
|
+
<li class="method">
|
1707
|
+
<div class="name">setNewestMessageAtTop</div>
|
1708
|
+
<div class="methodsignature"><code>void <strong>setNewestMessageAtTop</strong>(Boolean <em>newestMessageAtTop</em>)</code></div>
|
1709
|
+
<div class="summary">
|
1710
|
+
Sets whether to display new log messages at the top inside the pop-up window.
|
1711
|
+
</div>
|
1712
|
+
</li>
|
1713
|
+
<li class="method">
|
1714
|
+
<div class="name">isScrollToLatestMessage</div>
|
1715
|
+
<div class="methodsignature"><code>Boolean <strong>isScrollToLatestMessage</strong>()</code></div>
|
1716
|
+
<div class="summary">
|
1717
|
+
Returns whether the pop-up window scrolls to display the latest log message when a new message
|
1718
|
+
is logged. Default value is <code>true</code>.
|
1719
|
+
</div>
|
1720
|
+
</li>
|
1721
|
+
<li class="method">
|
1722
|
+
<div class="name">setScrollToLatestMessage</div>
|
1723
|
+
<div class="methodsignature"><code>void <strong>setScrollToLatestMessage</strong>(Boolean <em>scrollToLatestMessage</em>)</code></div>
|
1724
|
+
<div class="summary">
|
1725
|
+
Sets whether to scroll the pop-up window to display the latest log message when a new message
|
1726
|
+
is logged.
|
1727
|
+
</div>
|
1728
|
+
</li>
|
1729
|
+
<li class="method">
|
1730
|
+
<div class="name">isReopenWhenClosed</div>
|
1731
|
+
<div class="methodsignature"><code>Boolean <strong>isReopenWhenClosed</strong>()</code></div>
|
1732
|
+
<div class="summary">
|
1733
|
+
Returns whether the pop-up window reopens automatically after being closed when a new log message is logged.
|
1734
|
+
Default value is <code>false</code>.
|
1735
|
+
</div>
|
1736
|
+
</li>
|
1737
|
+
<li class="method">
|
1738
|
+
<div class="name">setReopenWhenClosed</div>
|
1739
|
+
<div class="methodsignature"><code>void <strong>setReopenWhenClosed</strong>(Boolean <em>reopenWhenClosed</em>)</code></div>
|
1740
|
+
<div class="summary">
|
1741
|
+
Sets whether to reopen the pop-up window automatically after being closed when a new log message is logged.
|
1742
|
+
</div>
|
1743
|
+
</li>
|
1744
|
+
<li class="method">
|
1745
|
+
<div class="name">getWidth</div>
|
1746
|
+
<div class="methodsignature"><code>Number <strong>getWidth</strong>()</code></div>
|
1747
|
+
<div class="summary">
|
1748
|
+
Returns the outer width in pixels of the pop-up window.
|
1749
|
+
</div>
|
1750
|
+
</li>
|
1751
|
+
<li class="method">
|
1752
|
+
<div class="name">setWidth</div>
|
1753
|
+
<div class="methodsignature"><code>void <strong>setWidth</strong>(Number <em>width</em>)</code></div>
|
1754
|
+
<div class="summary">
|
1755
|
+
[<em>not available after initialization</em>]
|
1756
|
+
<br />
|
1757
|
+
Sets the outer width in pixels of the pop-up window.
|
1758
|
+
</div>
|
1759
|
+
</li>
|
1760
|
+
<li class="method">
|
1761
|
+
<div class="name">getHeight</div>
|
1762
|
+
<div class="methodsignature"><code>Number <strong>getHeight</strong>()</code></div>
|
1763
|
+
<div class="summary">
|
1764
|
+
[<em>not available after initialization</em>]
|
1765
|
+
<br />
|
1766
|
+
Returns the outer height in pixels of the pop-up window.
|
1767
|
+
</div>
|
1768
|
+
</li>
|
1769
|
+
<li class="method">
|
1770
|
+
<div class="name">setHeight</div>
|
1771
|
+
<div class="methodsignature"><code>void <strong>setHeight</strong>(Number <em>height</em>)</code></div>
|
1772
|
+
<div class="summary">
|
1773
|
+
Sets the outer height in pixels of the pop-up window.
|
1774
|
+
</div>
|
1775
|
+
</li>
|
1776
|
+
<li class="method">
|
1777
|
+
<div class="name">getMaxMessages</div>
|
1778
|
+
<div class="methodsignature"><code>Number <strong>getMaxMessages</strong>()</code></div>
|
1779
|
+
<div class="summary">
|
1780
|
+
Returns the largest number of log messages that are displayed and stored
|
1781
|
+
by the the console. Once reached, a new log message wil cause the
|
1782
|
+
oldest message to be discarded. Default value is <code>null</code>, which means no
|
1783
|
+
limit is applied.
|
1784
|
+
</div>
|
1785
|
+
</li>
|
1786
|
+
<li class="method">
|
1787
|
+
<div class="name">setMaxMessages</div>
|
1788
|
+
<div class="methodsignature"><code>void <strong>setMaxMessages</strong>(Number <em>maxMessages</em>)</code></div>
|
1789
|
+
<div class="summary">
|
1790
|
+
[<em>not available after initialization</em>]
|
1791
|
+
<br />
|
1792
|
+
Sets the largest number of messages displayed and stored by the console window. Set
|
1793
|
+
this to <code>null</code> to make this number unlimited.
|
1794
|
+
</div>
|
1795
|
+
</li>
|
1796
|
+
<li class="method">
|
1797
|
+
<div class="name">isShowCommandLine</div>
|
1798
|
+
<div class="methodsignature"><code>Boolean <strong>isShowCommandLine</strong>()</code></div>
|
1799
|
+
<div class="summary">
|
1800
|
+
Returns whether the console includes a command line.
|
1801
|
+
Default value is <code>true</code>.
|
1802
|
+
</div>
|
1803
|
+
</li>
|
1804
|
+
<li class="method">
|
1805
|
+
<div class="name">setShowCommandLine</div>
|
1806
|
+
<div class="methodsignature"><code>void <strong>setShowCommandLine</strong>(Boolean <em>showCommandLine</em>)</code></div>
|
1807
|
+
<div class="summary">
|
1808
|
+
Sets whether the console includes a command line.
|
1809
|
+
</div>
|
1810
|
+
</li>
|
1811
|
+
<li class="method">
|
1812
|
+
<div class="name">getCommandLineObjectExpansionDepth</div>
|
1813
|
+
<div class="methodsignature"><code>Number <strong>getCommandLineObjectExpansionDepth</strong>()</code></div>
|
1814
|
+
<div class="summary">
|
1815
|
+
Returns the number of levels to expand when an object value is logged to the console.
|
1816
|
+
Each property of an object above this threshold will be expanded if it is itself an object
|
1817
|
+
or array, otherwise its string representation will be displayed. Default value is 1 (i.e.
|
1818
|
+
the properties of the object logged will be displayed in their string representation but
|
1819
|
+
not expanded).
|
1820
|
+
</div>
|
1821
|
+
</li>
|
1822
|
+
<li class="method">
|
1823
|
+
<div class="name">setCommandLineObjectExpansionDepth:</div>
|
1824
|
+
<div class="methodsignature"><code>void <strong>setCommandLineObjectExpansionDepth</strong>(Number <em>expansionDepth</em>)</code></div>
|
1825
|
+
<div class="summary">
|
1826
|
+
Sets the number of levels to expand when an object value is logged to the console.
|
1827
|
+
</div>
|
1828
|
+
</li>
|
1829
|
+
<li class="method">
|
1830
|
+
<div class="name">getCommandWindow</div>
|
1831
|
+
<div class="methodsignature"><code>Window <strong>getCommandWindow</strong>()</code></div>
|
1832
|
+
<div class="summary">
|
1833
|
+
Returns a reference to the window in which commands typed into the command line
|
1834
|
+
are currently being executed.
|
1835
|
+
</div>
|
1836
|
+
</li>
|
1837
|
+
<li class="method">
|
1838
|
+
<div class="name">setCommandWindow</div>
|
1839
|
+
<div class="methodsignature"><code>void <strong>setCommandWindow</strong>(Window <em>commandWindow</em>)</code></div>
|
1840
|
+
<div class="summary">
|
1841
|
+
Sets the window in which commands typed into the command line are executed.
|
1842
|
+
</div>
|
1843
|
+
</li>
|
1844
|
+
<li class="method">
|
1845
|
+
<div class="name">getCommandLayout</div>
|
1846
|
+
<div class="methodsignature"><code>Number <strong>getCommandLayout</strong>()</code></div>
|
1847
|
+
<div class="summary">
|
1848
|
+
Returns the layout used to format the output for commands typed into the command line.
|
1849
|
+
The default value is a <code><a href="#patternlayout">PatternLayout</a></code> with
|
1850
|
+
pattern string <code>%m</code>
|
1851
|
+
</div>
|
1852
|
+
</li>
|
1853
|
+
<li class="method">
|
1854
|
+
<div class="name">setCommandLayout</div>
|
1855
|
+
<div class="methodsignature"><code>void <strong>setCommandLayout</strong>(Layout <em>commandLayout</em>)</code></div>
|
1856
|
+
<div class="summary">
|
1857
|
+
Sets the layout used to format the output for commands typed into the command line.
|
1858
|
+
</div>
|
1859
|
+
</li>
|
1860
|
+
<li class="method">
|
1861
|
+
<div class="name">clear</div>
|
1862
|
+
<div class="methodsignature"><code>void <strong>clear</strong>()</code></div>
|
1863
|
+
<div class="summary">
|
1864
|
+
Clears all messages from the console window.
|
1865
|
+
</div>
|
1866
|
+
</li>
|
1867
|
+
<li class="method">
|
1868
|
+
<div class="name">close</div>
|
1869
|
+
<div class="methodsignature"><code>void <strong>close</strong>()</code></div>
|
1870
|
+
<div class="summary">
|
1871
|
+
Closes the pop-up window.
|
1872
|
+
</div>
|
1873
|
+
</li>
|
1874
|
+
<li class="method">
|
1875
|
+
<div class="name">show</div>
|
1876
|
+
<div class="methodsignature"><code>void <strong>show</strong>()</code></div>
|
1877
|
+
<div class="summary">
|
1878
|
+
Opens the pop-up window, if not already open.
|
1879
|
+
</div>
|
1880
|
+
</li>
|
1881
|
+
<li class="method">
|
1882
|
+
<div class="name">hide</div>
|
1883
|
+
<div class="methodsignature"><code>void <strong>hide</strong>()</code></div>
|
1884
|
+
<div class="summary">
|
1885
|
+
Closes the pop-up window.
|
1886
|
+
</div>
|
1887
|
+
</li>
|
1888
|
+
<li class="method">
|
1889
|
+
<div class="name">focus</div>
|
1890
|
+
<div class="methodsignature"><code>void <strong>focus</strong>()</code></div>
|
1891
|
+
<div class="summary">
|
1892
|
+
Brings the console window to the top and gives it the focus.
|
1893
|
+
</div>
|
1894
|
+
</li>
|
1895
|
+
<li class="method">
|
1896
|
+
<div class="name">focusCommandLine</div>
|
1897
|
+
<div class="methodsignature"><code>void <strong>focusCommandLine</strong>()</code></div>
|
1898
|
+
<div class="summary">
|
1899
|
+
Brings the console window to the top and gives the focus to the command line.
|
1900
|
+
</div>
|
1901
|
+
</li>
|
1902
|
+
<li class="method">
|
1903
|
+
<div class="name">focusSearch</div>
|
1904
|
+
<div class="methodsignature"><code>void <strong>focusSearch</strong>()</code></div>
|
1905
|
+
<div class="summary">
|
1906
|
+
Brings the console window to the top and gives the focus to the search box.
|
1907
|
+
</div>
|
1908
|
+
</li>
|
1909
|
+
<li class="method">
|
1910
|
+
<div class="name">evalCommandAndAppend</div>
|
1911
|
+
<div class="methodsignature"><code>void <strong>evalCommandAndAppend</strong>(String <em>expr</em>)</code></div>
|
1912
|
+
<div class="summary">
|
1913
|
+
Evaluates the expression and appends the result to the console.
|
1914
|
+
</div>
|
1915
|
+
</li>
|
1916
|
+
<li class="method">
|
1917
|
+
<div class="name">addCommandLineFunction</div>
|
1918
|
+
<div class="methodsignature"><code>void <strong>addCommandLineFunction</strong>(String <em>functionName</em>, Function <em>commandLineFunction</em>)</code></div>
|
1919
|
+
<div class="summary">
|
1920
|
+
<p>
|
1921
|
+
Adds a function with the name specified to the list of functions available on the command line.
|
1922
|
+
This feature may be used to add custom functions to the command line.
|
1923
|
+
</p>
|
1924
|
+
<p>
|
1925
|
+
When you call the function on the command line, <code>commandLineFunction</code> is executed with the
|
1926
|
+
following three parameters:
|
1927
|
+
</p>
|
1928
|
+
<ul>
|
1929
|
+
<li><em>appender</em>. A reference to the appender in which the command was executed;</li>
|
1930
|
+
<li><em>args</em>.
|
1931
|
+
An array-like list of parameters passed into the function on the command line
|
1932
|
+
(actually a reference to the <code>arguments</code> object representing the parameters passed
|
1933
|
+
into the function by the user);</li>
|
1934
|
+
<li><em>returnValue</em>. This is an object with two properties that allow the function to control
|
1935
|
+
how the result is displayed:
|
1936
|
+
<ul>
|
1937
|
+
<li><em>appendResult</em>. A boolean value that determines whether the returned value from this
|
1938
|
+
function is appended to the console. The default value is <code>true</code>;</li>
|
1939
|
+
<li><em>isError</em>. A boolean value that specifies whether the output of this function
|
1940
|
+
should be displayed as an error. The default value is <code>false</code>.</li>
|
1941
|
+
</ul>
|
1942
|
+
</li>
|
1943
|
+
</ul>
|
1944
|
+
<p>
|
1945
|
+
The value returned by the function is formatted by the command layout and appended to the console.
|
1946
|
+
</p>
|
1947
|
+
</div>
|
1948
|
+
</li>
|
1949
|
+
</ul>
|
1950
|
+
<p class="linktotop">
|
1951
|
+
<a href="#container">Top</a>
|
1952
|
+
</p>
|
1953
|
+
</div>
|
1954
|
+
<div id="inpageappender">
|
1955
|
+
<h3>InPageAppender</h3>
|
1956
|
+
<p class="editions">Editions: <strong>Standard</strong></p>
|
1957
|
+
<p>
|
1958
|
+
Logs messages to a console window in the page. The console is identical
|
1959
|
+
to that used by the <code><a href="#popupappender">PopUpAppender</a></code>, except
|
1960
|
+
for the absence of a 'Close' button.
|
1961
|
+
</p>
|
1962
|
+
<p><strong>Notes</strong></p>
|
1963
|
+
<ul>
|
1964
|
+
<li>
|
1965
|
+
Prior to log4javascript 1.3, InPageAppender was known as InlineAppender.
|
1966
|
+
For the sake of backwards compatibility, InlineAppender is still included in
|
1967
|
+
1.3 and later as an alias for InPageAppender.
|
1968
|
+
</li>
|
1969
|
+
<li>
|
1970
|
+
<p>
|
1971
|
+
The default layout for this appender is <code><a href="#patternlayout">PatternLayout</a></code>
|
1972
|
+
with pattern string
|
1973
|
+
</p>
|
1974
|
+
<p>
|
1975
|
+
<code>%d{HH:mm:ss} %-5p - %m{1}%n</code>
|
1976
|
+
</p>
|
1977
|
+
</li>
|
1978
|
+
</ul>
|
1979
|
+
<h4>Constructor</h4>
|
1980
|
+
<ul class="propertieslist">
|
1981
|
+
<li class="method">
|
1982
|
+
<div class="name">InPageAppender</div>
|
1983
|
+
<div class="methodsignature">
|
1984
|
+
<code><strong>InPageAppender</strong>(HTMLElement <em>container</em>[,
|
1985
|
+
Boolean <em>lazyInit</em>, Boolean <em>initiallyMinimized</em>,
|
1986
|
+
Boolean <em>useDocumentWrite</em>, String <em>width</em>, String <em>height</em>])</code>
|
1987
|
+
</div>
|
1988
|
+
<div class="paramsheading">Parameters:</div>
|
1989
|
+
<ul class="params">
|
1990
|
+
<li class="param">
|
1991
|
+
<code class="paramname">container</code>
|
1992
|
+
<div>
|
1993
|
+
The container element for the console window. This should be an HTML element.
|
1994
|
+
</div>
|
1995
|
+
</li>
|
1996
|
+
<li class="param">
|
1997
|
+
<code class="paramname">lazyInit</code>
|
1998
|
+
[<em>optional</em>]
|
1999
|
+
<div>
|
2000
|
+
Set this to <code>true</code> to create the console only when the first log
|
2001
|
+
message reaches the appender. Otherwise, the console is initialized as soon as the
|
2002
|
+
appender is created. If not specified, defaults to <code>true</code>.
|
2003
|
+
</div>
|
2004
|
+
</li>
|
2005
|
+
<li class="param">
|
2006
|
+
<code class="paramname">initiallyMinimized</code>
|
2007
|
+
[<em>optional</em>]
|
2008
|
+
<div>
|
2009
|
+
<p>
|
2010
|
+
Whether the console window should start off hidden / minimized.
|
2011
|
+
If not specified, defaults to <code>false</code>.
|
2012
|
+
</p>
|
2013
|
+
<p><strong>Notes</strong></p>
|
2014
|
+
<ul>
|
2015
|
+
<li>
|
2016
|
+
In Safari (and possibly other browsers) hiding an <code>iframe</code>
|
2017
|
+
resets its document, thus destroying the console window.
|
2018
|
+
</li>
|
2019
|
+
</ul>
|
2020
|
+
</div>
|
2021
|
+
</li>
|
2022
|
+
<li class="param">
|
2023
|
+
<code class="paramname">useDocumentWrite</code>
|
2024
|
+
[<em>optional</em>]
|
2025
|
+
<div>
|
2026
|
+
<p>
|
2027
|
+
Specifies how the console window is created. By default, the console window is
|
2028
|
+
created dynamically using <code>document</code>'s <code>write</code> method. This has the
|
2029
|
+
advantage of keeping all the code in one single JavaScript file. However, if your
|
2030
|
+
page sets <code>document.domain</code> then the browser prevents script access to
|
2031
|
+
a window unless it too has the same value set for <code>document.domain</code>. To
|
2032
|
+
get round this issue, you can set <code>useDocumentWrite</code> to <code>false</code>
|
2033
|
+
and log4javascript will instead use the external HTML file <code>console.html</code>
|
2034
|
+
(or <code>console_uncompressed.html</code> if you're using an uncompressed version of
|
2035
|
+
log4javascript.js), which must be placed in the same directory as your log4javascript.js file.
|
2036
|
+
</p>
|
2037
|
+
<p>
|
2038
|
+
In general it's simpler to use the <code>document.write</code> method, so unless your
|
2039
|
+
page needs to set <code>document.domain</code>, <code>useDocumentWrite</code> should
|
2040
|
+
be set to <code>true</code>.
|
2041
|
+
</p>
|
2042
|
+
<p>
|
2043
|
+
If not specified, defaults to <code>true</code>.
|
2044
|
+
</p>
|
2045
|
+
</div>
|
2046
|
+
</li>
|
2047
|
+
<li class="param">
|
2048
|
+
<code class="paramname">width</code>
|
2049
|
+
[<em>optional</em>]
|
2050
|
+
<div>
|
2051
|
+
The width of the console window. Any valid CSS length may be used. If not
|
2052
|
+
specified, defaults to <code>100%</code>.
|
2053
|
+
</div>
|
2054
|
+
</li>
|
2055
|
+
<li class="param">
|
2056
|
+
<code class="paramname">height</code>
|
2057
|
+
[<em>optional</em>]
|
2058
|
+
<div>
|
2059
|
+
The height of the console window. Any valid CSS length may be used. If not
|
2060
|
+
specified, defaults to <code>250px</code>.
|
2061
|
+
</div>
|
2062
|
+
</li>
|
2063
|
+
</ul>
|
2064
|
+
</li>
|
2065
|
+
</ul>
|
2066
|
+
<h4>Methods</h4>
|
2067
|
+
<ul class="propertieslist">
|
2068
|
+
<li class="method">
|
2069
|
+
<div class="name">addCssProperty</div>
|
2070
|
+
<div class="methodsignature"><code>void <strong>addCssProperty</strong>(String <em>name</em>, String <em>value</em>)</code></div>
|
2071
|
+
<div class="summary">
|
2072
|
+
Sets a CSS style property on the HTML element containing the console iframe.
|
2073
|
+
</div>
|
2074
|
+
</li>
|
2075
|
+
<li class="method">
|
2076
|
+
<div class="name">isVisible</div>
|
2077
|
+
<div class="methodsignature"><code>Boolean <strong>isVisible</strong>()</code></div>
|
2078
|
+
<div class="summary">
|
2079
|
+
Returns whether the console window is currently visible.
|
2080
|
+
</div>
|
2081
|
+
</li>
|
2082
|
+
<li class="method">
|
2083
|
+
<div class="name">isInitiallyMinimized</div>
|
2084
|
+
<div class="methodsignature"><code>Boolean <strong>isInitiallyMinimized</strong>()</code></div>
|
2085
|
+
<div class="summary">
|
2086
|
+
Returns whether the console window starts off hidden / minimized.
|
2087
|
+
</div>
|
2088
|
+
</li>
|
2089
|
+
<li class="method">
|
2090
|
+
<div class="name">setInitiallyMinimized</div>
|
2091
|
+
<div class="methodsignature"><code>void <strong>setInitiallyMinimized</strong>(Boolean <em>initiallyMinimized</em>)</code></div>
|
2092
|
+
<div class="summary">
|
2093
|
+
[<em>not available after initialization</em>]
|
2094
|
+
<br />
|
2095
|
+
Sets whether the console window should start off hidden / minimized.
|
2096
|
+
</div>
|
2097
|
+
</li>
|
2098
|
+
<li class="method">
|
2099
|
+
<div class="name">isNewestMessageAtTop</div>
|
2100
|
+
<div class="methodsignature"><code>Boolean <strong>isNewestMessageAtTop</strong>()</code></div>
|
2101
|
+
<div class="summary">
|
2102
|
+
Returns whether new log messages are displayed at the top of the console window.
|
2103
|
+
</div>
|
2104
|
+
</li>
|
2105
|
+
<li class="method">
|
2106
|
+
<div class="name">setNewestMessageAtTop</div>
|
2107
|
+
<div class="methodsignature"><code>void <strong>setNewestMessageAtTop</strong>(Boolean <em>newestMessageAtTop</em>)</code></div>
|
2108
|
+
<div class="summary">
|
2109
|
+
Sets whether to display new log messages at the top inside the console window.
|
2110
|
+
</div>
|
2111
|
+
</li>
|
2112
|
+
<li class="method">
|
2113
|
+
<div class="name">isScrollToLatestMessage</div>
|
2114
|
+
<div class="methodsignature"><code>Boolean <strong>isScrollToLatestMessage</strong>()</code></div>
|
2115
|
+
<div class="summary">
|
2116
|
+
Returns whether the pop-up window scrolls to display the latest log message when a new message
|
2117
|
+
is logged.
|
2118
|
+
</div>
|
2119
|
+
</li>
|
2120
|
+
<li class="method">
|
2121
|
+
<div class="name">setScrollToLatestMessage</div>
|
2122
|
+
<div class="methodsignature"><code>void <strong>setScrollToLatestMessage</strong>(Boolean <em>scrollToLatestMessage</em>)</code></div>
|
2123
|
+
<div class="summary">
|
2124
|
+
Sets whether to scroll the console window to display the latest log message when a new message
|
2125
|
+
is logged.
|
2126
|
+
</div>
|
2127
|
+
</li>
|
2128
|
+
<li class="method">
|
2129
|
+
<div class="name">getWidth</div>
|
2130
|
+
<div class="methodsignature"><code>String <strong>getWidth</strong>()</code></div>
|
2131
|
+
<div class="summary">
|
2132
|
+
Returns the outer width of the console window.
|
2133
|
+
</div>
|
2134
|
+
</li>
|
2135
|
+
<li class="method">
|
2136
|
+
<div class="name">setWidth</div>
|
2137
|
+
<div class="methodsignature"><code>void <strong>setWidth</strong>(String <em>width</em>)</code></div>
|
2138
|
+
<div class="summary">
|
2139
|
+
[<em>not available after initialization</em>]
|
2140
|
+
<br />
|
2141
|
+
Sets the outer width of the console window. Any valid CSS length may be used.
|
2142
|
+
</div>
|
2143
|
+
</li>
|
2144
|
+
<li class="method">
|
2145
|
+
<div class="name">getHeight</div>
|
2146
|
+
<div class="methodsignature"><code>String <strong>getHeight</strong>()</code></div>
|
2147
|
+
<div class="summary">
|
2148
|
+
Returns the outer height of the console window.
|
2149
|
+
</div>
|
2150
|
+
</li>
|
2151
|
+
<li class="method">
|
2152
|
+
<div class="name">setHeight</div>
|
2153
|
+
<div class="methodsignature"><code>void <strong>setHeight</strong>(String <em>height</em>)</code></div>
|
2154
|
+
<div class="summary">
|
2155
|
+
[<em>not available after initialization</em>]
|
2156
|
+
<br />
|
2157
|
+
Sets the outer height of the console window. Any valid CSS length may be used.
|
2158
|
+
</div>
|
2159
|
+
</li>
|
2160
|
+
<li class="method">
|
2161
|
+
<div class="name">getMaxMessages</div>
|
2162
|
+
<div class="methodsignature"><code>Number <strong>getMaxMessages</strong>()</code></div>
|
2163
|
+
<div class="summary">
|
2164
|
+
Returns the largest number of messages displayed and stored by the console window.
|
2165
|
+
</div>
|
2166
|
+
</li>
|
2167
|
+
<li class="method">
|
2168
|
+
<div class="name">setMaxMessages</div>
|
2169
|
+
<div class="methodsignature"><code>void <strong>setMaxMessages</strong>(Number <em>maxMessages</em>)</code></div>
|
2170
|
+
<div class="summary">
|
2171
|
+
[<em>not available after initialization</em>]
|
2172
|
+
<br />
|
2173
|
+
Sets the largest number of messages displayed and stored by the console window. Set
|
2174
|
+
this to <code>null</code> to make this number unlimited.
|
2175
|
+
</div>
|
2176
|
+
</li>
|
2177
|
+
<li class="method">
|
2178
|
+
<div class="name">isShowCommandLine</div>
|
2179
|
+
<div class="methodsignature"><code>Boolean <strong>isShowCommandLine</strong>()</code></div>
|
2180
|
+
<div class="summary">
|
2181
|
+
Returns whether the console includes a command line.
|
2182
|
+
Default value is <code>true</code>.
|
2183
|
+
</div>
|
2184
|
+
</li>
|
2185
|
+
<li class="method">
|
2186
|
+
<div class="name">setShowCommandLine</div>
|
2187
|
+
<div class="methodsignature"><code>void <strong>setShowCommandLine</strong>(Boolean <em>showCommandLine</em>)</code></div>
|
2188
|
+
<div class="summary">
|
2189
|
+
Sets whether the console includes a command line.
|
2190
|
+
</div>
|
2191
|
+
</li>
|
2192
|
+
<li class="method">
|
2193
|
+
<div class="name">getCommandLineObjectExpansionDepth</div>
|
2194
|
+
<div class="methodsignature"><code>Number <strong>getCommandLineObjectExpansionDepth</strong>()</code></div>
|
2195
|
+
<div class="summary">
|
2196
|
+
Returns the number of levels to expand when an object value is logged to the console.
|
2197
|
+
Each property of an object above this threshold will be expanded if it is itself an object
|
2198
|
+
or array, otherwise its string representation will be displayed. Default value is 1 (i.e.
|
2199
|
+
the properties of the object logged will be displayed in their string representation but
|
2200
|
+
not expanded).
|
2201
|
+
</div>
|
2202
|
+
</li>
|
2203
|
+
<li class="method">
|
2204
|
+
<div class="name">setCommandLineObjectExpansionDepth:</div>
|
2205
|
+
<div class="methodsignature"><code>void <strong>setCommandLineObjectExpansionDepth</strong>(Number <em>expansionDepth</em>)</code></div>
|
2206
|
+
<div class="summary">
|
2207
|
+
Sets the number of levels to expand when an object value is logged to the console.
|
2208
|
+
</div>
|
2209
|
+
</li>
|
2210
|
+
<li class="method">
|
2211
|
+
<div class="name">getCommandWindow</div>
|
2212
|
+
<div class="methodsignature"><code>Window <strong>getCommandWindow</strong>()</code></div>
|
2213
|
+
<div class="summary">
|
2214
|
+
Returns a reference to the window in which commands typed into the command line
|
2215
|
+
are currently being executed.
|
2216
|
+
</div>
|
2217
|
+
</li>
|
2218
|
+
<li class="method">
|
2219
|
+
<div class="name">setCommandWindow</div>
|
2220
|
+
<div class="methodsignature"><code>void <strong>setCommandWindow</strong>(Window <em>commandWindow</em>)</code></div>
|
2221
|
+
<div class="summary">
|
2222
|
+
Sets the window in which commands typed into the command line are executed.
|
2223
|
+
</div>
|
2224
|
+
</li>
|
2225
|
+
<li class="method">
|
2226
|
+
<div class="name">getCommandLayout</div>
|
2227
|
+
<div class="methodsignature"><code>Number <strong>getCommandLayout</strong>()</code></div>
|
2228
|
+
<div class="summary">
|
2229
|
+
Returns the layout used to format the output for commands typed into the command line.
|
2230
|
+
The default value is a <code><a href="#patternlayout">PatternLayout</a></code> with
|
2231
|
+
pattern string <code>%m</code>
|
2232
|
+
</div>
|
2233
|
+
</li>
|
2234
|
+
<li class="method">
|
2235
|
+
<div class="name">setCommandLayout</div>
|
2236
|
+
<div class="methodsignature"><code>void <strong>setCommandLayout</strong>(Layout <em>commandLayout</em>)</code></div>
|
2237
|
+
<div class="summary">
|
2238
|
+
Sets the layout used to format the output for commands typed into the command line.
|
2239
|
+
</div>
|
2240
|
+
</li>
|
2241
|
+
<li class="method">
|
2242
|
+
<div class="name">clear</div>
|
2243
|
+
<div class="methodsignature"><code>void <strong>clear</strong>()</code></div>
|
2244
|
+
<div class="summary">
|
2245
|
+
Clears all messages from the console window.
|
2246
|
+
</div>
|
2247
|
+
</li>
|
2248
|
+
<li class="method">
|
2249
|
+
<div class="name">show</div>
|
2250
|
+
<div class="methodsignature"><code>void <strong>show</strong>()</code></div>
|
2251
|
+
<div class="summary">
|
2252
|
+
<p>
|
2253
|
+
Shows / unhides the console window.
|
2254
|
+
</p>
|
2255
|
+
<p><strong>Notes</strong></p>
|
2256
|
+
<ul>
|
2257
|
+
<li>
|
2258
|
+
In Safari (and possibly other browsers), hiding an <code>iframe</code>
|
2259
|
+
resets its document, thus destroying the console window.
|
2260
|
+
</li>
|
2261
|
+
</ul>
|
2262
|
+
</div>
|
2263
|
+
</li>
|
2264
|
+
<li class="method">
|
2265
|
+
<div class="name">hide</div>
|
2266
|
+
<div class="methodsignature"><code>void <strong>hide</strong>()</code></div>
|
2267
|
+
<div class="summary">
|
2268
|
+
<p>
|
2269
|
+
Hides / minimizes the console window.
|
2270
|
+
</p>
|
2271
|
+
<p><strong>Notes</strong></p>
|
2272
|
+
<ul>
|
2273
|
+
<li>
|
2274
|
+
In Safari (and possibly other browsers), hiding an <code>iframe</code>
|
2275
|
+
resets its document, thus destroying the console window.
|
2276
|
+
</li>
|
2277
|
+
</ul>
|
2278
|
+
</div>
|
2279
|
+
</li>
|
2280
|
+
<li class="method">
|
2281
|
+
<div class="name">close</div>
|
2282
|
+
<div class="methodsignature"><code>void <strong>close</strong>()</code></div>
|
2283
|
+
<div class="summary">
|
2284
|
+
Removes the console window iframe from the main document.
|
2285
|
+
</div>
|
2286
|
+
</li>
|
2287
|
+
<li class="method">
|
2288
|
+
<div class="name">focus</div>
|
2289
|
+
<div class="methodsignature"><code>void <strong>focus</strong>()</code></div>
|
2290
|
+
<div class="summary">
|
2291
|
+
Brings the console window to the top and gives it the focus.
|
2292
|
+
</div>
|
2293
|
+
</li>
|
2294
|
+
<li class="method">
|
2295
|
+
<div class="name">focusCommandLine</div>
|
2296
|
+
<div class="methodsignature"><code>void <strong>focusCommandLine</strong>()</code></div>
|
2297
|
+
<div class="summary">
|
2298
|
+
Brings the console window to the top and gives the focus to the command line.
|
2299
|
+
</div>
|
2300
|
+
</li>
|
2301
|
+
<li class="method">
|
2302
|
+
<div class="name">focusSearch</div>
|
2303
|
+
<div class="methodsignature"><code>void <strong>focusSearch</strong>()</code></div>
|
2304
|
+
<div class="summary">
|
2305
|
+
Brings the console window to the top and gives the focus to the search box.
|
2306
|
+
</div>
|
2307
|
+
</li>
|
2308
|
+
<li class="method">
|
2309
|
+
<div class="name">evalCommandAndAppend</div>
|
2310
|
+
<div class="methodsignature"><code>void <strong>evalCommandAndAppend</strong>(String <em>expr</em>)</code></div>
|
2311
|
+
<div class="summary">
|
2312
|
+
Evaluates the expression and appends the result to the console.
|
2313
|
+
</div>
|
2314
|
+
</li>
|
2315
|
+
<li class="method">
|
2316
|
+
<div class="name">addCommandLineFunction</div>
|
2317
|
+
<div class="methodsignature"><code>void <strong>addCommandLineFunction</strong>(String <em>functionName</em>, Function <em>commandLineFunction</em>)</code></div>
|
2318
|
+
<div class="summary">
|
2319
|
+
<p>
|
2320
|
+
Adds a function with the name specified to the list of functions available on the command line.
|
2321
|
+
This feature may be used to add custom functions to the command line.
|
2322
|
+
</p>
|
2323
|
+
<p>
|
2324
|
+
When you call the function on the command line, <code>commandLineFunction</code> is executed with the
|
2325
|
+
following three parameters:
|
2326
|
+
</p>
|
2327
|
+
<ul>
|
2328
|
+
<li><em>appender</em>. A reference to the appender in which the command was executed;</li>
|
2329
|
+
<li><em>args</em>.
|
2330
|
+
An array-like list of parameters passed into the function on the command line
|
2331
|
+
(actually a reference to an <code>arguments</code> object);</li>
|
2332
|
+
<li><em>returnValue</em>. This is an object with two properties that allow the function to control
|
2333
|
+
how the result is displayed:
|
2334
|
+
<ul>
|
2335
|
+
<li><em>appendResult</em>. A boolean value that determines whether the returned value from this
|
2336
|
+
function is appended to the console. The default value is <code>true</code>;</li>
|
2337
|
+
<li><em>isError</em>. A boolean value that specifies whether the output of this function
|
2338
|
+
should be displayed as an error. The default value is <code>false</code>.</li>
|
2339
|
+
</ul>
|
2340
|
+
</li>
|
2341
|
+
</ul>
|
2342
|
+
<p>
|
2343
|
+
The value returned by the function is formatted by the command layout and appended to the console.
|
2344
|
+
</p>
|
2345
|
+
</div>
|
2346
|
+
</li>
|
2347
|
+
</ul>
|
2348
|
+
<p class="linktotop">
|
2349
|
+
<a href="#container">Top</a>
|
2350
|
+
</p>
|
2351
|
+
</div>
|
2352
|
+
<div id="browserconsoleappender">
|
2353
|
+
<h3>BrowserConsoleAppender</h3>
|
2354
|
+
<p class="editions">Editions: <strong>Standardl</strong></p>
|
2355
|
+
<p>
|
2356
|
+
Writes log messages to the browser's built-in console, if present. This only works
|
2357
|
+
currently in Safari, Opera and Firefox with the excellent
|
2358
|
+
<a href="http://www.getfirebug.com" title="Firebug home page (opens in new window)"
|
2359
|
+
target="_blank">Firebug</a> extension installed.
|
2360
|
+
</p>
|
2361
|
+
<p><strong>Notes</strong></p>
|
2362
|
+
<ul>
|
2363
|
+
<li>
|
2364
|
+
As of log4javascript 1.3, the default threshold for this appender is <code>DEBUG</code>
|
2365
|
+
as opposed to <code>WARN</code> as it was previously;
|
2366
|
+
</li>
|
2367
|
+
<li>
|
2368
|
+
<p>
|
2369
|
+
As of version 1.3, log4javascript has explicit support for Firebug's logging. This includes
|
2370
|
+
the following mapping of log4javascript's log levels onto Firebug's:
|
2371
|
+
</p>
|
2372
|
+
<ul>
|
2373
|
+
<li>log4javascript <code>TRACE</code>, <code>DEBUG</code> -> Firebug <code>debug</code></li>
|
2374
|
+
<li>log4javascript <code>INFO</code> -> Firebug <code>info</code></li>
|
2375
|
+
<li>log4javascript <code>WARN</code> -> Firebug <code>warn</code></li>
|
2376
|
+
<li>log4javascript <code>ERROR</code>, <code>FATAL</code> -> Firebug <code>error</code></li>
|
2377
|
+
</ul>
|
2378
|
+
<p>
|
2379
|
+
... and the ability to pass objects into Firebug and take advantage of its object inspection.
|
2380
|
+
This is because the default layout is now <code><a href="#nulllayout">NullLayout</a></code>,
|
2381
|
+
which performs no formatting on an object.
|
2382
|
+
</p>
|
2383
|
+
</li>
|
2384
|
+
</ul>
|
2385
|
+
<h4>Constructor</h4>
|
2386
|
+
<ul class="propertieslist">
|
2387
|
+
<li class="method">
|
2388
|
+
<div class="name">BrowserConsoleAppender</div>
|
2389
|
+
<div class="methodsignature"><code><strong>BrowserConsoleAppender</strong>()</code></div>
|
2390
|
+
</li>
|
2391
|
+
</ul>
|
2392
|
+
<p class="linktotop">
|
2393
|
+
<a href="#container">Top</a>
|
2394
|
+
</p>
|
2395
|
+
</div>
|
2396
|
+
</div>
|
2397
|
+
<div id="layouts">
|
2398
|
+
<h2>Layouts</h2>
|
2399
|
+
<div id="layout">
|
2400
|
+
<h3>Layout</h3>
|
2401
|
+
<p>
|
2402
|
+
There are a few methods common to all layouts:
|
2403
|
+
</p>
|
2404
|
+
<h4>Methods</h4>
|
2405
|
+
<ul class="propertieslist">
|
2406
|
+
<li class="method">
|
2407
|
+
<div class="name">format</div>
|
2408
|
+
<div class="methodsignature"><code>String <strong>format</strong>(LoggingEvent <em>loggingEvent</em>)</code></div>
|
2409
|
+
<div class="paramsheading">Parameters:</div>
|
2410
|
+
<ul class="params">
|
2411
|
+
<li class="param">
|
2412
|
+
<code class="paramname">loggingEvent</code>
|
2413
|
+
</li>
|
2414
|
+
</ul>
|
2415
|
+
<div class="summary">
|
2416
|
+
Formats the log message. You should override this method in your own layouts.
|
2417
|
+
</div>
|
2418
|
+
</li>
|
2419
|
+
<li class="method">
|
2420
|
+
<div class="name">ignoresThrowable</div>
|
2421
|
+
<div class="methodsignature"><code>Boolean <strong>ignoresThrowable</strong>()</code></div>
|
2422
|
+
<div class="summary">
|
2423
|
+
Returns whether the layout ignores an error object in a logging event passed
|
2424
|
+
to its <code>format</code> method.
|
2425
|
+
</div>
|
2426
|
+
</li>
|
2427
|
+
<li class="method">
|
2428
|
+
<div class="name">getContentType</div>
|
2429
|
+
<div class="methodsignature"><code>String <strong>getContentType</strong>()</code></div>
|
2430
|
+
<div class="summary">
|
2431
|
+
Returns the content type of the output of the layout.
|
2432
|
+
</div>
|
2433
|
+
</li>
|
2434
|
+
<li class="method">
|
2435
|
+
<div class="name">allowBatching</div>
|
2436
|
+
<div class="methodsignature"><code>Boolean <strong>allowBatching</strong>()</code></div>
|
2437
|
+
<div class="summary">
|
2438
|
+
Returns whether the layout's output is suitable for batching.
|
2439
|
+
<code><a href="#jsonlayout">JsonLayout</a></code> and <code><a href="#xmllayout">XmlLayout</a></code>
|
2440
|
+
are the only built-in layouts that return true for this method.
|
2441
|
+
</div>
|
2442
|
+
</li>
|
2443
|
+
<li class="method">
|
2444
|
+
<div class="name">getDataValues</div>
|
2445
|
+
<div class="methodsignature"><code>Array <strong>getDataValues</strong>(LoggingEvent <em>loggingEvent</em>)</code></div>
|
2446
|
+
<div class="paramsheading">Parameters:</div>
|
2447
|
+
<ul class="params">
|
2448
|
+
<li class="param">
|
2449
|
+
<code class="paramname">loggingEvent</code>
|
2450
|
+
</li>
|
2451
|
+
</ul>
|
2452
|
+
<div class="summary">
|
2453
|
+
Used internally by log4javascript in constructing formatted output for some layouts.
|
2454
|
+
</div>
|
2455
|
+
</li>
|
2456
|
+
<li class="method">
|
2457
|
+
<div class="name">setKeys</div>
|
2458
|
+
<div class="methodsignature"><code>void <strong>setKeys</strong>(String <em>loggerKey</em>,
|
2459
|
+
String <em>timeStampKey</em>, String <em>levelKey</em>, String <em>messageKey</em>,
|
2460
|
+
String <em>exceptionKey</em>, String <em>urlKey</em>)</code></div>
|
2461
|
+
<div class="paramsheading">Parameters:</div>
|
2462
|
+
<ul class="params">
|
2463
|
+
<li class="param">
|
2464
|
+
<code class="paramname">loggerKey</code>
|
2465
|
+
<div>
|
2466
|
+
Parameter to use for the log message's logger name. Default is <code>logger</code>.
|
2467
|
+
</div>
|
2468
|
+
</li>
|
2469
|
+
<li class="param">
|
2470
|
+
<code class="paramname">timeStampKey</code>
|
2471
|
+
<div>
|
2472
|
+
Parameter to use for the log message's timestamp. Default is <code>timestamp</code>.
|
2473
|
+
</div>
|
2474
|
+
</li>
|
2475
|
+
<li class="param">
|
2476
|
+
<code class="paramname">levelKey</code>
|
2477
|
+
<div>
|
2478
|
+
Parameter to use for the log message's level. Default is <code>level</code>.
|
2479
|
+
</div>
|
2480
|
+
</li>
|
2481
|
+
<li class="param">
|
2482
|
+
<code class="paramname">messageKey</code>
|
2483
|
+
<div>
|
2484
|
+
Parameter to use for the message itself. Default is <code>message</code>.
|
2485
|
+
</div>
|
2486
|
+
</li>
|
2487
|
+
<li class="param">
|
2488
|
+
<code class="paramname">exceptionKey</code>
|
2489
|
+
<div>
|
2490
|
+
Parameter to use for the log message's error (exception). Default is <code>exception</code>.
|
2491
|
+
</div>
|
2492
|
+
</li>
|
2493
|
+
<li class="param">
|
2494
|
+
<code class="paramname">urlKey</code>
|
2495
|
+
<div>
|
2496
|
+
Parameter to use for the current page URL. Default is <code>url</code>.
|
2497
|
+
</div>
|
2498
|
+
</li>
|
2499
|
+
</ul>
|
2500
|
+
<div class="summary">
|
2501
|
+
This method is used to change the default keys used to create formatted name-value pairs
|
2502
|
+
for the properties of a log message, for layouts that do this. These layouts are
|
2503
|
+
<code><a href="#jsonlayout">JsonLayout</a></code> and
|
2504
|
+
<code><a href="#httppostdatalayout">HttpPostDataLayout</a></code>.
|
2505
|
+
</div>
|
2506
|
+
</li>
|
2507
|
+
<li class="method">
|
2508
|
+
<div class="name">setCustomField</div>
|
2509
|
+
<div class="methodsignature"><code>void <strong>setCustomField</strong>(String <em>name</em>,
|
2510
|
+
String <em>value</em>)</code></div>
|
2511
|
+
<div class="paramsheading">Parameters:</div>
|
2512
|
+
<ul class="params">
|
2513
|
+
<li class="param">
|
2514
|
+
<code class="paramname">name</code>
|
2515
|
+
<div>
|
2516
|
+
Name of the custom property you wish to be included in the formmtted output.
|
2517
|
+
</div>
|
2518
|
+
</li>
|
2519
|
+
<li class="param">
|
2520
|
+
<code class="paramname">value</code>
|
2521
|
+
<div>
|
2522
|
+
Value of the custom property you wish to be included in the formatted output.
|
2523
|
+
</div>
|
2524
|
+
</li>
|
2525
|
+
</ul>
|
2526
|
+
<div class="summary">
|
2527
|
+
Some layouts (<code><a href="#jsonlayout">JsonLayout</a></code>,
|
2528
|
+
<code><a href="#httppostdatalayout">HttpPostDataLayout</a></code>,
|
2529
|
+
<code><a href="#patternlayout">PatternLayout</a></code> and
|
2530
|
+
<code><a href="#xmllayout">XmlLayout</a></code>) allow you to set
|
2531
|
+
custom fields (e.g. a session id to send to the server) to the
|
2532
|
+
formatted output. Use this method to set a custom field. If there
|
2533
|
+
is already a custom field with the specified name, its value will
|
2534
|
+
be updated with <code>value</code>.
|
2535
|
+
</div>
|
2536
|
+
<p><strong>Notes</strong></p>
|
2537
|
+
<ul>
|
2538
|
+
<li>
|
2539
|
+
<p>
|
2540
|
+
From version 1.4, the custom field value may be a function. In this
|
2541
|
+
case, the function is run at the time the layout's format method is called,
|
2542
|
+
with the following two parameters:
|
2543
|
+
</p>
|
2544
|
+
<ul>
|
2545
|
+
<li><em>layout</em>. A reference to the layout being used;</li>
|
2546
|
+
<li><em>loggingEvent</em>. A reference to the logging event being formatted.</li>
|
2547
|
+
</ul>
|
2548
|
+
</li>
|
2549
|
+
</ul>
|
2550
|
+
</li>
|
2551
|
+
<li class="method">
|
2552
|
+
<div class="name">hasCustomFields</div>
|
2553
|
+
<div class="methodsignature"><code>Boolean <strong>hasCustomFields</strong>()</code></div>
|
2554
|
+
<div class="summary">
|
2555
|
+
Returns whether the layout has any custom fields.
|
2556
|
+
</div>
|
2557
|
+
</li>
|
2558
|
+
</ul>
|
2559
|
+
<p class="linktotop">
|
2560
|
+
<a href="#container">Top</a>
|
2561
|
+
</p>
|
2562
|
+
</div>
|
2563
|
+
<div id="nulllayout">
|
2564
|
+
<h3>NullLayout</h3>
|
2565
|
+
<p class="editions">Editions: <strong>All</strong></p>
|
2566
|
+
<p>
|
2567
|
+
The most basic layout. NullLayout's <code>format()</code> methods performs no
|
2568
|
+
formatting at all and simply returns the message logged.
|
2569
|
+
</p>
|
2570
|
+
<h4>Constructor</h4>
|
2571
|
+
<ul class="propertieslist">
|
2572
|
+
<li class="method">
|
2573
|
+
<div class="name">NullLayout</div>
|
2574
|
+
<div class="methodsignature"><code><strong>NullLayout</strong>()</code></div>
|
2575
|
+
</li>
|
2576
|
+
</ul>
|
2577
|
+
<p class="linktotop">
|
2578
|
+
<a href="#container">Top</a>
|
2579
|
+
</p>
|
2580
|
+
</div>
|
2581
|
+
<div id="simplelayout">
|
2582
|
+
<h3>SimpleLayout</h3>
|
2583
|
+
<p class="editions">Editions: <strong>Standard, Production</strong></p>
|
2584
|
+
<p>
|
2585
|
+
Provides basic formatting. SimpleLayout consists of the level of the log statement,
|
2586
|
+
followed by " - " and then the log message itself. For example,
|
2587
|
+
</p>
|
2588
|
+
<p><code>DEBUG - Hello world</code></p>
|
2589
|
+
<h4>Constructor</h4>
|
2590
|
+
<ul class="propertieslist">
|
2591
|
+
<li class="method">
|
2592
|
+
<div class="name">SimpleLayout</div>
|
2593
|
+
<div class="methodsignature"><code><strong>SimpleLayout</strong>()</code></div>
|
2594
|
+
</li>
|
2595
|
+
</ul>
|
2596
|
+
<p class="linktotop">
|
2597
|
+
<a href="#container">Top</a>
|
2598
|
+
</p>
|
2599
|
+
</div>
|
2600
|
+
<div id="patternlayout">
|
2601
|
+
<h3>PatternLayout</h3>
|
2602
|
+
<p class="editions">Editions: <strong>All</strong></p>
|
2603
|
+
<p>
|
2604
|
+
Provides a flexible way of formatting a log message by means of a conversion pattern
|
2605
|
+
string. The behaviour of this layout is a full implementation of <code>PatternLayout</code>
|
2606
|
+
in log4j, with the exception of the set of conversion characters - log4javascript's is
|
2607
|
+
necessarily a subset of that of log4j with a few additions of its own, since many of
|
2608
|
+
the conversion characters in log4j only make sense in the context of Java.
|
2609
|
+
</p>
|
2610
|
+
<p>
|
2611
|
+
The conversion pattern consists of literal text interspersed with special strings starting with
|
2612
|
+
a % symbol called <em>conversion specifiers</em>. A conversion specifier consists of the
|
2613
|
+
% symbol, a conversion character (possible characters are listed below) and
|
2614
|
+
<em>format modifiers</em>. For full documentation of the conversion pattern, see
|
2615
|
+
<a href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html" target="_blank">log4j's
|
2616
|
+
documentation</a>. Below is a list of all conversion characters available in log4javascript.
|
2617
|
+
</p>
|
2618
|
+
<h4>Conversion characters</h4>
|
2619
|
+
<table border="1" cellspacing="0">
|
2620
|
+
<thead>
|
2621
|
+
<tr>
|
2622
|
+
<th>Conversion Character</th>
|
2623
|
+
<th>Effect</th>
|
2624
|
+
</tr>
|
2625
|
+
</thead>
|
2626
|
+
<tbody>
|
2627
|
+
<tr>
|
2628
|
+
<td>a</td>
|
2629
|
+
<td>
|
2630
|
+
<p>
|
2631
|
+
Outputs log messages specified as an array.
|
2632
|
+
</p>
|
2633
|
+
<p>
|
2634
|
+
Behaves exactly like <code>%m</code>, except that multiple log messages are
|
2635
|
+
assumed to have been specified in the logging call as an array rather than
|
2636
|
+
as multiple parameters.
|
2637
|
+
</p>
|
2638
|
+
<p>
|
2639
|
+
<strong>Since: 1.4</strong>
|
2640
|
+
</p>
|
2641
|
+
</td>
|
2642
|
+
</tr>
|
2643
|
+
<tr>
|
2644
|
+
<td>c</td>
|
2645
|
+
<td>
|
2646
|
+
<p>
|
2647
|
+
Outputs the logger name.
|
2648
|
+
</p>
|
2649
|
+
</td>
|
2650
|
+
</tr>
|
2651
|
+
<tr>
|
2652
|
+
<td>d</td>
|
2653
|
+
<td>
|
2654
|
+
<p>
|
2655
|
+
Outputs the date of the logging event. The date conversion specifier
|
2656
|
+
may be followed by a date format specifier enclosed between braces. For
|
2657
|
+
example, <code>%d{HH:mm:ss,SSS}</code> or
|
2658
|
+
<code>%d{dd MMM yyyy HH:mm:ss,SSS}</code>. If no date
|
2659
|
+
format specifier is given then ISO8601 format is assumed.
|
2660
|
+
</p>
|
2661
|
+
<p>
|
2662
|
+
The date format specifier is the same as that used by Java's
|
2663
|
+
<code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html"
|
2664
|
+
target="_blank">SimpleDateFormat</a></code>. log4javascript
|
2665
|
+
includes a full implementation of SimpleDateFormat's
|
2666
|
+
<code>format</code> method, with the exception of the pattern letter
|
2667
|
+
'z', (string representation of the timezone) for which the information
|
2668
|
+
is not available in JavaScript.
|
2669
|
+
</p>
|
2670
|
+
</td>
|
2671
|
+
</tr>
|
2672
|
+
<tr>
|
2673
|
+
<td>f</td>
|
2674
|
+
<td>
|
2675
|
+
<p>
|
2676
|
+
Outputs the value of a custom field set on the layout. If present, the specifier gives
|
2677
|
+
the index in the array of custom fields to use; otherwise, the first custom field in the
|
2678
|
+
array is used.
|
2679
|
+
</p>
|
2680
|
+
<p>
|
2681
|
+
<strong>Since: 1.3</strong>
|
2682
|
+
</p>
|
2683
|
+
</td>
|
2684
|
+
</tr>
|
2685
|
+
<tr>
|
2686
|
+
<td>m</td>
|
2687
|
+
<td>
|
2688
|
+
<p>
|
2689
|
+
Outputs the log messages of the logging event (i.e. the log
|
2690
|
+
messages supplied by the client code).
|
2691
|
+
</p>
|
2692
|
+
<p>
|
2693
|
+
As of version 1.4, multiple log messages may be supplied to logging calls.
|
2694
|
+
<code>%m</code> displays each log message (using the rules below) one after
|
2695
|
+
another, separated by spaces.
|
2696
|
+
</p>
|
2697
|
+
<p>
|
2698
|
+
As of version 1.3, an object may be specified as the log message and will
|
2699
|
+
be expanded to show its properties in the output, provided that a specifier
|
2700
|
+
containing the number of levels to expand is provided. If no specifier is
|
2701
|
+
provided then the message will be treated as a string regardless of its type.
|
2702
|
+
For example, <code>%m{1}</code> will display an expansion of the object one
|
2703
|
+
level deep, i.e. each property of the object will be displayed but if the
|
2704
|
+
property value is itself an object it will not be expanded and will appear
|
2705
|
+
as <code>[object Object]</code>.
|
2706
|
+
</p>
|
2707
|
+
</td>
|
2708
|
+
</tr>
|
2709
|
+
<tr>
|
2710
|
+
<td>n</td>
|
2711
|
+
<td>
|
2712
|
+
<p>
|
2713
|
+
Outputs a line separator.
|
2714
|
+
</p>
|
2715
|
+
</td>
|
2716
|
+
</tr>
|
2717
|
+
<tr>
|
2718
|
+
<td>p</td>
|
2719
|
+
<td>
|
2720
|
+
<p>
|
2721
|
+
Outputs the level of the logging event.
|
2722
|
+
</p>
|
2723
|
+
</td>
|
2724
|
+
</tr>
|
2725
|
+
<tr>
|
2726
|
+
<td>r</td>
|
2727
|
+
<td>
|
2728
|
+
<p>
|
2729
|
+
Outputs the number of milliseconds since log4javascript was initialized.
|
2730
|
+
</p>
|
2731
|
+
</td>
|
2732
|
+
</tr>
|
2733
|
+
<tr>
|
2734
|
+
<td>%</td>
|
2735
|
+
<td>
|
2736
|
+
<p>
|
2737
|
+
The sequence %% outputs a single percent sign.
|
2738
|
+
</p>
|
2739
|
+
</td>
|
2740
|
+
</tr>
|
2741
|
+
</tbody>
|
2742
|
+
</table>
|
2743
|
+
<h4>Static properties</h4>
|
2744
|
+
<ul class="propertieslist">
|
2745
|
+
<li class="property">
|
2746
|
+
<div class="name">TTCC_CONVERSION_PATTERN</div>
|
2747
|
+
<div class="summary">
|
2748
|
+
Built-in conversion pattern, equivalent to <code>%r %p %c - %m%n</code>.
|
2749
|
+
</div>
|
2750
|
+
</li>
|
2751
|
+
<li class="property">
|
2752
|
+
<div class="name">DEFAULT_CONVERSION_PATTERN</div>
|
2753
|
+
<div class="summary">
|
2754
|
+
Built-in conversion pattern, equivalent to <code>%m%n</code>.
|
2755
|
+
</div>
|
2756
|
+
</li>
|
2757
|
+
<li class="property">
|
2758
|
+
<div class="name">ISO8601_DATEFORMAT</div>
|
2759
|
+
<div class="summary">
|
2760
|
+
Built-in date format (and also the default), equivalent to
|
2761
|
+
<code>yyyy-MM-dd HH:mm:ss,SSS</code>.
|
2762
|
+
</div>
|
2763
|
+
</li>
|
2764
|
+
<li class="property">
|
2765
|
+
<div class="name">DATETIME_DATEFORMAT</div>
|
2766
|
+
<div class="summary">
|
2767
|
+
Built-in date format, equivalent to <code>dd MMM YYYY HH:mm:ss,SSS</code>.
|
2768
|
+
</div>
|
2769
|
+
</li>
|
2770
|
+
<li class="property">
|
2771
|
+
<div class="name">ABSOLUTETIME_DATEFORMAT</div>
|
2772
|
+
<div class="summary">
|
2773
|
+
Built-in date format, equivalent to <code>HH:mm:ss,SSS</code>.
|
2774
|
+
</div>
|
2775
|
+
</li>
|
2776
|
+
</ul>
|
2777
|
+
<h4>Constructor</h4>
|
2778
|
+
<ul class="propertieslist">
|
2779
|
+
<li class="method">
|
2780
|
+
<div class="name">PatternLayout</div>
|
2781
|
+
<div class="methodsignature"><code><strong>PatternLayout</strong>(String <em>pattern</em>)</code></div>
|
2782
|
+
<div class="paramsheading">Parameters:</div>
|
2783
|
+
<ul class="params">
|
2784
|
+
<li class="param">
|
2785
|
+
<code class="paramname">pattern</code>
|
2786
|
+
<div>
|
2787
|
+
The conversion pattern string to use.
|
2788
|
+
</div>
|
2789
|
+
</li>
|
2790
|
+
</ul>
|
2791
|
+
</li>
|
2792
|
+
</ul>
|
2793
|
+
<p class="linktotop">
|
2794
|
+
<a href="#container">Top</a>
|
2795
|
+
</p>
|
2796
|
+
</div>
|
2797
|
+
<div id="xmllayout">
|
2798
|
+
<h3>XmlLayout</h3>
|
2799
|
+
<p class="editions">Editions: <strong>Standard, Production</strong></p>
|
2800
|
+
<p>
|
2801
|
+
Based on log4j's <code>XmlLayout</code>, this layout formats a log message as a
|
2802
|
+
fragment of XML. An example of the format of the fragment is as follows:
|
2803
|
+
</p>
|
2804
|
+
<pre>
|
2805
|
+
<log4javascript:event logger="[default]" timestamp="1201048234203" level="ERROR">
|
2806
|
+
<log4javascript:message><![CDATA[Big problem!]]></log4javascript:message>
|
2807
|
+
<log4javascript:exception><![CDATA[Nasty error on line number 1
|
2808
|
+
in file http://log4javascript.org/test.html]]></log4javascript:exception>
|
2809
|
+
</log4javascript:event>
|
2810
|
+
</pre>
|
2811
|
+
<p><strong>Notes</strong></p>
|
2812
|
+
<ul>
|
2813
|
+
<li>
|
2814
|
+
This layout supports batching of log messages when used in an
|
2815
|
+
<code><a href="#ajaxappender">AjaxAppender</a></code>. A batch of
|
2816
|
+
messages is simply concatenated to form a string of several XML
|
2817
|
+
frgaments similar to that above.
|
2818
|
+
</li>
|
2819
|
+
<li>
|
2820
|
+
The <code><log4javascript:exception></code> element is only present if an
|
2821
|
+
exception was passed into the original log call.
|
2822
|
+
</li>
|
2823
|
+
<li>
|
2824
|
+
As of version 1.4, timestamps are returned as milliseconds since midnight of
|
2825
|
+
January 1, 1970 rather than seconds as in previous versions. This allows finer
|
2826
|
+
measurement of the time a logging event occurred and is also the JavaScript
|
2827
|
+
<code>Date</code> object's standard measurement.
|
2828
|
+
</li>
|
2829
|
+
<li>
|
2830
|
+
Also as of version 1.4, multiple messages may be specified as separate parameters
|
2831
|
+
in a single logging call. In <code>XmlLayout</code>, multiple messages may be
|
2832
|
+
formatted as a single combined message or may be formated as several
|
2833
|
+
<code><log4javascript:message></code> elements inside one
|
2834
|
+
<code><log4javascript:messages></code> element as shown below:
|
2835
|
+
<br />
|
2836
|
+
<pre>
|
2837
|
+
<log4javascript:event logger="[default]" timestamp="1201048234203" level="ERROR">
|
2838
|
+
<log4javascript:messages>
|
2839
|
+
<log4javascript:message><![CDATA[Big problem!]]></log4javascript:message>
|
2840
|
+
<log4javascript:message><![CDATA[Value of x when this error
|
2841
|
+
occurred: 3]]></log4javascript:message>
|
2842
|
+
</log4javascript:messages>
|
2843
|
+
<log4javascript:exception><![CDATA[Nasty error on line number 1
|
2844
|
+
in file http://log4javascript.org/test.html]]></log4javascript:exception>
|
2845
|
+
</log4javascript:event>
|
2846
|
+
</pre>
|
2847
|
+
</li>
|
2848
|
+
<li>
|
2849
|
+
As of version 1.3, custom fields may be added to the output. Each field will
|
2850
|
+
add a tag of the following form inside the <code><log4javascript:event></code>
|
2851
|
+
tag:
|
2852
|
+
<br />
|
2853
|
+
<pre>
|
2854
|
+
<log4javascript:customfield name="sessionid"><![CDATA[1234]]></log4javascript:customfield>
|
2855
|
+
</pre>
|
2856
|
+
</li>
|
2857
|
+
</ul>
|
2858
|
+
<h4>Constructor</h4>
|
2859
|
+
<ul class="propertieslist">
|
2860
|
+
<li class="method">
|
2861
|
+
<div class="name">XmlLayout</div>
|
2862
|
+
<div class="methodsignature"><code><strong>XmlLayout</strong>([Boolean <em>combineMessages</em>])</code></div>
|
2863
|
+
<ul class="params">
|
2864
|
+
<li class="param">
|
2865
|
+
<code class="paramname">combineMessages</code>
|
2866
|
+
<div>
|
2867
|
+
Whether or not to format multiple log messages as a combined single
|
2868
|
+
<code><log4javascript:message></code> element
|
2869
|
+
composed of each individual message separated by line breaks or to include
|
2870
|
+
a <code><log4javascript:message></code> element for each message inside
|
2871
|
+
one <code><log4javascript:messages></code> element.
|
2872
|
+
If not specified, defaults to <code>true</code>.
|
2873
|
+
</div>
|
2874
|
+
</li>
|
2875
|
+
</ul>
|
2876
|
+
</li>
|
2877
|
+
</ul>
|
2878
|
+
<p class="linktotop">
|
2879
|
+
<a href="#container">Top</a>
|
2880
|
+
</p>
|
2881
|
+
</div>
|
2882
|
+
<div id="jsonlayout">
|
2883
|
+
<h3>JsonLayout</h3>
|
2884
|
+
<p class="editions">Editions: <strong>Standard, Production</strong></p>
|
2885
|
+
<p>
|
2886
|
+
Formats a logging event into JavaScript Object Notation (JSON).
|
2887
|
+
JSON is a subset of JavaScript's object literal syntax, meaning that log
|
2888
|
+
messages formatted with this layout can be interpreted directly by JavaScript
|
2889
|
+
and converted into objects. See
|
2890
|
+
<a href="http://json.org/" target="_blank" title="json.org (opens in new window)">json.org</a> for more details
|
2891
|
+
about JSON.
|
2892
|
+
</p>
|
2893
|
+
<p>Example:</p>
|
2894
|
+
<pre>
|
2895
|
+
{
|
2896
|
+
"logger": "[default]",
|
2897
|
+
"timeStamp": 1201048234203,
|
2898
|
+
"level": "ERROR",
|
2899
|
+
"url": "http://log4javascript.org/test.html",
|
2900
|
+
"message": "Big problem!",
|
2901
|
+
"exception": "Nasty error on line number 1 in file
|
2902
|
+
http://log4javascript.org/test.html"
|
2903
|
+
}
|
2904
|
+
</pre>
|
2905
|
+
<p>
|
2906
|
+
The <code>exception</code> property is only present if an exception was passed
|
2907
|
+
into the original log call.
|
2908
|
+
</p>
|
2909
|
+
<p><strong>Notes</strong></p>
|
2910
|
+
<ul>
|
2911
|
+
<li>
|
2912
|
+
This layout supports batching of log messages when used in an
|
2913
|
+
<code><a href="#ajaxappender">AjaxAppender</a></code>. When sent singly
|
2914
|
+
the layout formats the log message as a single JavaScript object literal;
|
2915
|
+
when sent as a batch, the messages are formatted as an array literal whose
|
2916
|
+
elements are log message objects.
|
2917
|
+
</li>
|
2918
|
+
<li>
|
2919
|
+
<p>
|
2920
|
+
As of version 1.3, custom fields may be added to the output. Each field will
|
2921
|
+
add a property of the following form to the main object literal:
|
2922
|
+
</p>
|
2923
|
+
<pre>
|
2924
|
+
"sessionid": 1234
|
2925
|
+
</pre>
|
2926
|
+
</li>
|
2927
|
+
<li>
|
2928
|
+
From version 1.4, the variable names used for log event properties such as
|
2929
|
+
the message, timestamp and exception are specified using the <code>setKeys()</code>
|
2930
|
+
method of <code><a href="#layout">Layout</a></code>.
|
2931
|
+
</li>
|
2932
|
+
<li>
|
2933
|
+
<p>
|
2934
|
+
Also as of version 1.4, multiple messages may be specified as separate parameters
|
2935
|
+
in a single logging call. In <code>JsonLayout</code>, multiple messages may be
|
2936
|
+
formatted as a single combined message or may be formated as an array of messages
|
2937
|
+
as shown below:
|
2938
|
+
</p>
|
2939
|
+
<pre>
|
2940
|
+
{
|
2941
|
+
"logger": "[default]",
|
2942
|
+
"timeStamp": 1201048234203,
|
2943
|
+
"level": "ERROR",
|
2944
|
+
"url": "http://log4javascript.org/test.html",
|
2945
|
+
"message": [
|
2946
|
+
"Big problem!",
|
2947
|
+
"Value of x when this error occurred: 3"
|
2948
|
+
],
|
2949
|
+
"exception": "Nasty error on line number 1 in file
|
2950
|
+
http://log4javascript.org/test.html"
|
2951
|
+
}
|
2952
|
+
</pre>
|
2953
|
+
</li>
|
2954
|
+
</ul>
|
2955
|
+
<h4>Constructor</h4>
|
2956
|
+
<ul class="propertieslist">
|
2957
|
+
<li class="method">
|
2958
|
+
<div class="name">JsonLayout</div>
|
2959
|
+
<div class="methodsignature"><code><strong>JsonLayout</strong>([Boolean <em>readable</em>, Boolean <em>combineMessages</em>])</code></div>
|
2960
|
+
<div class="paramsheading">Parameters:</div>
|
2961
|
+
<ul class="params">
|
2962
|
+
<li class="param">
|
2963
|
+
<code class="paramname">readable</code>
|
2964
|
+
<div>
|
2965
|
+
Whether or not to format each log message with line breaks and tabs.
|
2966
|
+
If not specified, defaults to <code>false</code>.
|
2967
|
+
</div>
|
2968
|
+
</li>
|
2969
|
+
<li class="param">
|
2970
|
+
<code class="paramname">combineMessages</code>
|
2971
|
+
<div>
|
2972
|
+
Whether or not to format multiple log messages as a combined single
|
2973
|
+
<code>message</code> property composed of each individual message separated by line
|
2974
|
+
breaks or to format multiple messages as an array.
|
2975
|
+
If not specified, defaults to <code>true</code>.
|
2976
|
+
</div>
|
2977
|
+
</li>
|
2978
|
+
</ul>
|
2979
|
+
</li>
|
2980
|
+
</ul>
|
2981
|
+
<h4>Methods</h4>
|
2982
|
+
<ul class="propertieslist">
|
2983
|
+
<li class="method">
|
2984
|
+
<div class="name">isReadable</div>
|
2985
|
+
<div class="methodsignature"><code>Boolean <strong>isReadable</strong>()</code></div>
|
2986
|
+
<div class="summary">
|
2987
|
+
Returns whether or not to each log message is formatted with line breaks and tabs.
|
2988
|
+
</div>
|
2989
|
+
<p><strong>Notes</strong></p>
|
2990
|
+
<ul>
|
2991
|
+
<li>
|
2992
|
+
<p>
|
2993
|
+
<code>setReadable</code> has been removed in version 1.4. This property can
|
2994
|
+
be set via the constructor.
|
2995
|
+
</p>
|
2996
|
+
</li>
|
2997
|
+
</ul>
|
2998
|
+
</li>
|
2999
|
+
</ul>
|
3000
|
+
</div>
|
3001
|
+
<div id="httppostdatalayout">
|
3002
|
+
<h3>HttpPostDataLayout</h3>
|
3003
|
+
<p class="editions">Editions: <strong>Standard, Production</strong></p>
|
3004
|
+
<p>
|
3005
|
+
Formats the log message as a simple URL-encoded string from which a simple
|
3006
|
+
server-side script may extract parameters such as the log message, severity
|
3007
|
+
and timestamp. This is the default layout for
|
3008
|
+
<code><a href="#ajaxappender">AjaxAppender</a></code>.
|
3009
|
+
</p>
|
3010
|
+
<h4>Constructor</h4>
|
3011
|
+
<ul class="propertieslist">
|
3012
|
+
<li class="method">
|
3013
|
+
<div class="name">HttpPostDataLayout</div>
|
3014
|
+
<div class="methodsignature"><code><strong>HttpPostDataLayout</strong>()</code></div>
|
3015
|
+
</li>
|
3016
|
+
</ul>
|
3017
|
+
<p><strong>Notes</strong></p>
|
3018
|
+
<ul>
|
3019
|
+
<li>
|
3020
|
+
As of version 1.3, custom fields may be added to the output. Each field will
|
3021
|
+
be added as a parameter to the post data.
|
3022
|
+
</li>
|
3023
|
+
<li>
|
3024
|
+
From version 1.4, the variable names used for log event properties such as
|
3025
|
+
the message, timestamp and exception are specified using the <code>setKeys()</code>
|
3026
|
+
method of <code><a href="#layout">Layout</a></code>.
|
3027
|
+
</li>
|
3028
|
+
</ul>
|
3029
|
+
<p class="linktotop">
|
3030
|
+
<a href="#container">Top</a>
|
3031
|
+
</p>
|
3032
|
+
</div>
|
3033
|
+
</div>
|
3034
|
+
<div id="enabling">
|
3035
|
+
<h2>Enabling / disabling log4javascript</h2>
|
3036
|
+
<p>
|
3037
|
+
All logging can be enabled or disabled in log4javascript in a number of ways:
|
3038
|
+
</p>
|
3039
|
+
<ul>
|
3040
|
+
<li>
|
3041
|
+
At any time, you can call
|
3042
|
+
<code>log4javascript.setEnabled(<em>enabled</em>)</code>. This will
|
3043
|
+
enable or disable all logging, depending on whether <code>enabled</code>
|
3044
|
+
is set to <code>true</code> or <code>false</code>.
|
3045
|
+
</li>
|
3046
|
+
<li>
|
3047
|
+
<p>
|
3048
|
+
Assign a value to the global variable <code>log4javascript_disabled</code>.
|
3049
|
+
The idea of this is so that you can enable or disable logging for a whole site by
|
3050
|
+
including a JavaScript file in all your pages, and allowing this file to be
|
3051
|
+
included <strong>before</strong> log4javascript.js to guarantee that no logging
|
3052
|
+
can take place without having to alter log4javascript.js itself. Your included
|
3053
|
+
.js file would include a single line such as the following:
|
3054
|
+
</p>
|
3055
|
+
<p>
|
3056
|
+
<code>var log4javascript_disabled = true;</code>
|
3057
|
+
</p>
|
3058
|
+
</li>
|
3059
|
+
<li>
|
3060
|
+
Assign your logger object a value of <code>log4javascript.getNullLogger()</code>.
|
3061
|
+
</li>
|
3062
|
+
<li>
|
3063
|
+
Replace your copy of log4javascript_x.js with stubs/log4javascript_x.js, provided in the
|
3064
|
+
distribution. This file has a stub version of each of the functions and methods
|
3065
|
+
in the log4javascript API and can simply be dropped in in place of the main file.
|
3066
|
+
The compressed version of the stub is typically 15 times smaller than the
|
3067
|
+
compressed version of the main file.
|
3068
|
+
</li>
|
3069
|
+
</ul>
|
3070
|
+
<p class="linktotop">
|
3071
|
+
<a href="#container">Top</a>
|
3072
|
+
</p>
|
3073
|
+
</div>
|
3074
|
+
<div id="errorhandling">
|
3075
|
+
<h2>log4javascript error handling</h2>
|
3076
|
+
<p>
|
3077
|
+
log4javascript has a single rudimentary logger-like object of its own to handle
|
3078
|
+
messages generated by log4javascript itself. This logger is called <code>LogLog</code>
|
3079
|
+
and is accessed via <code>log4javascript.logLog</code>.
|
3080
|
+
</p>
|
3081
|
+
<div id="loglog">
|
3082
|
+
<h4>Methods</h4>
|
3083
|
+
<ul class="propertieslist">
|
3084
|
+
<li class="method">
|
3085
|
+
<div class="name">setQuietMode</div>
|
3086
|
+
<div class="methodsignature"><code>void <strong>setQuietMode</strong>(Boolean <em>quietMode</em>)</code></div>
|
3087
|
+
<div class="paramsheading">Parameters:</div>
|
3088
|
+
<ul class="params">
|
3089
|
+
<li class="param">
|
3090
|
+
<code class="paramname">quietMode</code>
|
3091
|
+
<div>
|
3092
|
+
Whether to turn quiet mode on or off.
|
3093
|
+
</div>
|
3094
|
+
</li>
|
3095
|
+
</ul>
|
3096
|
+
<div class="summary">
|
3097
|
+
Sets whether <code>LogLog</code> is in quiet mode or not. In quiet mode, no
|
3098
|
+
messages sent to <code>LogLog</code> have any visible effect. By default,
|
3099
|
+
quiet mode is switched off.
|
3100
|
+
</div>
|
3101
|
+
</li>
|
3102
|
+
<li class="method">
|
3103
|
+
<div class="name">setAlertAllErrors</div>
|
3104
|
+
<div class="methodsignature"><code>void <strong>setAlertAllErrors</strong>(Boolean <em>alertAllErrors</em>)</code></div>
|
3105
|
+
<div class="paramsheading">Parameters:</div>
|
3106
|
+
<ul class="params">
|
3107
|
+
<li class="param">
|
3108
|
+
<code class="paramname">showAllErrors</code>
|
3109
|
+
<div>
|
3110
|
+
Whether to show all errors or just the first.
|
3111
|
+
</div>
|
3112
|
+
</li>
|
3113
|
+
</ul>
|
3114
|
+
<div class="summary">
|
3115
|
+
Sets how many errors <code>LogLog</code> will display alerts for. By default,
|
3116
|
+
only the first error encountered generates an alert to the user. If you turn
|
3117
|
+
all errors on by supplying <code>true</code> to this method then all errors
|
3118
|
+
will generate alerts.
|
3119
|
+
</div>
|
3120
|
+
</li>
|
3121
|
+
<li class="method">
|
3122
|
+
<div class="name">debug</div>
|
3123
|
+
<div class="methodsignature"><code>void <strong>debug</strong>(String <em>message</em>[, Error <em>exception</em>])</code></div>
|
3124
|
+
<div class="paramsheading">Parameters:</div>
|
3125
|
+
<ul class="params">
|
3126
|
+
<li class="param">
|
3127
|
+
<code class="paramname">message</code>
|
3128
|
+
</li>
|
3129
|
+
<li class="param">
|
3130
|
+
<code class="paramname">exception</code>
|
3131
|
+
[<em>optional</em>]
|
3132
|
+
</li>
|
3133
|
+
</ul>
|
3134
|
+
<div class="summary">
|
3135
|
+
Logs a debugging message to an in-memory list. This implementation is new in version 1.4.
|
3136
|
+
</div>
|
3137
|
+
</li>
|
3138
|
+
<li class="method">
|
3139
|
+
<div class="name">displayDebug</div>
|
3140
|
+
<div class="methodsignature"><code>void <strong>displayDebug</strong>()</code></div>
|
3141
|
+
<div class="summary">
|
3142
|
+
Displays an alert of all debugging messages. This method is new in version 1.4.
|
3143
|
+
</div>
|
3144
|
+
</li>
|
3145
|
+
<li class="method">
|
3146
|
+
<div class="name">warn</div>
|
3147
|
+
<div class="methodsignature"><code>void <strong>warn</strong>(String <em>message</em>[, Error <em>exception</em>])</code></div>
|
3148
|
+
<div class="paramsheading">Parameters:</div>
|
3149
|
+
<ul class="params">
|
3150
|
+
<li class="param">
|
3151
|
+
<code class="paramname">message</code>
|
3152
|
+
</li>
|
3153
|
+
<li class="param">
|
3154
|
+
<code class="paramname">exception</code>
|
3155
|
+
[<em>optional</em>]
|
3156
|
+
</li>
|
3157
|
+
</ul>
|
3158
|
+
<div class="summary">
|
3159
|
+
Currently has no effect.
|
3160
|
+
</div>
|
3161
|
+
</li>
|
3162
|
+
<li class="method">
|
3163
|
+
<div class="name">error</div>
|
3164
|
+
<div class="methodsignature"><code>void <strong>error</strong>(String <em>message</em>[, Error <em>exception</em>])</code></div>
|
3165
|
+
<div class="paramsheading">Parameters:</div>
|
3166
|
+
<ul class="params">
|
3167
|
+
<li class="param">
|
3168
|
+
<code class="paramname">message</code>
|
3169
|
+
</li>
|
3170
|
+
<li class="param">
|
3171
|
+
<code class="paramname">exception</code>
|
3172
|
+
[<em>optional</em>]
|
3173
|
+
</li>
|
3174
|
+
</ul>
|
3175
|
+
<div class="summary">
|
3176
|
+
Generates an alert to the user if and only if the error is the first one
|
3177
|
+
encountered and <code>setAlertAllErrors(true)</code> has not been called.
|
3178
|
+
</div>
|
3179
|
+
</li>
|
3180
|
+
</ul>
|
3181
|
+
<p class="linktotop">
|
3182
|
+
<a href="#container">Top</a>
|
3183
|
+
</p>
|
3184
|
+
</div>
|
3185
|
+
</div>
|
3186
|
+
<div id="differences">
|
3187
|
+
<h2>Differences between log4javascript and log4j</h2>
|
3188
|
+
<p>
|
3189
|
+
For the sake of keeping log4javascript as light and useful as possible, many
|
3190
|
+
of the features of log4j that seem over-complex or inappropriate for
|
3191
|
+
JavaScript have not been implemented. These include:
|
3192
|
+
</p>
|
3193
|
+
<ul>
|
3194
|
+
<li>Filters</li>
|
3195
|
+
<li>Configurators</li>
|
3196
|
+
<li>Renderers</li>
|
3197
|
+
</ul>
|
3198
|
+
<p class="linktotop">
|
3199
|
+
<a href="#container">Top</a>
|
3200
|
+
</p>
|
3201
|
+
</div>
|
3202
|
+
</div>
|
3203
|
+
<div id="footer">
|
3204
|
+
<span class="externallinkinfo">
|
3205
|
+
<strong>NB.</strong> All external links open in a new window.
|
3206
|
+
</span>
|
3207
|
+
Written by Tim Down. <a href="mailto:tim@log4javascript.org">tim@log4javascript.org</a>
|
3208
|
+
<br />
|
3209
|
+
log4javascript is distributed under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html"
|
3210
|
+
title="Apache License, Version 2.0 (opens in new window)" target="_blank">Apache License,
|
3211
|
+
Version 2.0</a>
|
3212
|
+
|
3213
|
+
</div>
|
3214
|
+
</div>
|
3215
|
+
|
3216
|
+
</body>
|
3217
|
+
</html>
|