X
點擊此處開啟此網站的行動版。

技術支援討論區

Log HTTP request/response from/to page to a file

已張貼

First of all I am aware about https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging

The problem that this kind of logging not log body of request/response in readable format . For example I knew that my page made REST calls in JSON format but I fail to find JSON text in generated log file only some HEX format digits .

Is there any way to add human readable body content to this kind of logging ? Or is there any other way to log http header + body ? Proxy solution not possible in my case .

First of all I am aware about https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging The problem that this kind of logging not log body of request/response in readable format . For example I knew that my page made REST calls in JSON format but I fail to find JSON text in generated log file only some HEX format digits . Is there any way to add human readable body content to this kind of logging ? Or is there any other way to log http header + body ? Proxy solution not possible in my case .

額外的系統細節

已安裝的外掛程式

  • Shockwave Flash 11.2 r202
  • Next Generation Java Plug-in 10.65.2 for Mozilla browsers
  • Mime Type x-skype for Skype Buttons
  • Plugin for Installing Applications (new)

應用程式

  • Firefox 31.1.0
  • 使用者代理:Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0
  • 技術支援網址:https://support.mozilla.org/1/firefox/31.1.0/Linux/en-US/

擴充套件

  • Clear Cache 2.0.1 (clearcache@michel.de.almeida)
  • Clear Cache Button 0.9f ({563e4790-7e70-11da-a72b-0800200c9a66})
  • Firebug 2.0.4 (firebug@software.joehewitt.com)
  • FirePath 0.9.7 (FireXPath@pierre.tholence.com)
  • openSUSE Firefox Extensions 1.0.2 (susefox@opensuse.org)
  • Poster 3.1.0 ({d48a39ba-8f80-4fce-8ee1-bc710561c55d})
  • Troubleshooter 1.1a (troubleshooter@mozilla.org)

JavaScript

  • incrementalGCEnabled: True

圖形

  • adapterDescription: Intel Open Source Technology Center -- Mesa DRI Intel(R) Ivybridge Desktop x86/MMX/SSE2
  • adapterDeviceID: Mesa DRI Intel(R) Ivybridge Desktop x86/MMX/SSE2
  • adapterDrivers:
  • adapterRAM:
  • adapterVendorID: Intel Open Source Technology Center
  • driverDate:
  • driverVersion: 3.0 Mesa 9.2.3
  • info: {u'AzureCanvasBackend': u'cairo', u'AzureFallbackCanvasBackend': u'none', u'AzureContentBackend': u'cairo', u'AzureSkiaAccelerated': 0}
  • numAcceleratedWindows: 0
  • numAcceleratedWindowsMessage: [u'']
  • numTotalWindows: 1
  • webglRenderer: Intel Open Source Technology Center -- Mesa DRI Intel(R) Ivybridge Desktop x86/MMX/SSE2
  • windowLayerManagerRemote: False
  • windowLayerManagerType: Basic

修改過的偏好設定

  • accessibility.typeaheadfind.flashBar: 0
  • browser.cache.disk.capacity: 358400
  • browser.cache.disk.smart_size.first_run: False
  • browser.cache.disk.smart_size.use_old_max: False
  • browser.cache.disk.smart_size_cached_value: 358400
  • browser.cache.frecency_experiment: 2
  • browser.places.importBookmarksHTML: False
  • browser.places.smartBookmarksVersion: 7
  • browser.sessionstore.upgradeBackup.latestBuildID: 2014082900
  • browser.startup.homepage: about:home
  • browser.startup.homepage_override.buildID: 2014082900
  • browser.startup.homepage_override.mstone: 31.1.0
  • browser.tabs.closeButtons: 1
  • browser.tabs.warnOnClose: False
  • browser.tabs.warnOnOpen: False
  • dom.mozApps.used: True
  • extensions.lastAppVersion: 31.1.0
  • network.cookie.prefsMigrated: True
  • places.database.lastMaintenance: 1414578111
  • places.history.expiration.transient_current_max_pages: 104858
  • plugin.disable_full_page_plugin_for_types: application/pdf
  • plugin.importedState: True
  • privacy.cpd.offlineApps: True
  • privacy.cpd.siteSettings: True
  • privacy.sanitize.migrateFx3Prefs: True
  • privacy.sanitize.timeSpan: 0
  • storage.vacuum.last.index: 1
  • storage.vacuum.last.places.sqlite: 1412242365

其他

  • User JS: 否
  • 輔助功能: 否
cor-el
  • Top 10 Contributor
  • Moderator
17407 個解決方法 157253 個答案
Try the Live Http Headers extension. *https://addons.mozilla.org/firefox/addon/live-http-headers/

提出問題者

Thanks for your answer , but Live HTTP Headers add-on have same disadvantage as Mozilla Debugging - it don't provide body of request/ response . Also it looks like I will need to filter which responses to log and which not . I interested only in REST / AJAX calls from page and don't need to log image / scripts loading .

I still open for suggestion but currently I see only one choice - write my own extension will handle all as I actually need :)

Thanks for your answer , but Live HTTP Headers add-on have same disadvantage as Mozilla Debugging - it don't provide body of request/ response . Also it looks like I will need to filter which responses to log and which not . I interested only in REST / AJAX calls from page and don't need to log image / scripts loading . I still open for suggestion but currently I see only one choice - write my own extension will handle all as I actually need :)