Logging user's browser and version

Bruce Imhoff June 21, 2011

Is it possible to log the user's web browser and the version of that browser in Confluence when they log in to the application? I'm not very familiar with detailed configuration of logging, so I would be grateful for any help or pointers.

The purpose is to identify those users still using old browsers (IE6) and get them upgraded.

4 answers

1 accepted

1 vote
Answer accepted
Jim Birch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 21, 2011

Add the AccessLogValve to the configuration

open <app dir>\conf\server.xlm

Add the Valve setting inside server/service/engine/host/context section ie after the "logger is depreciated..." comment

<!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in
confluence/WEB-INF/classes/log4j.properties -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="access." suffix=".log" pattern="combined" resolveHosts="false"/>

Save file and restart Confluence service

Creates access log files <app dir>\logs\access.yyyy-mm-dd.log

You need the "combined" pattern value to get the browser type. For less information use the value "common".

Tomcat doc ref: http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html

Note: This doesn't log a user id, just an ip address so you'd need to link in some othe data. Maybe the Tomcat layer doesn't know who's at the ip.

Bruce Imhoff June 27, 2011

Excellent advice, thanks. I'll try to link the IP address to the user in one of the logs, thanks!

1 vote
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 23, 2011

Is the purpose of this to collect usernames for your IT dept to do the upgrade? Or to alert users that their browser is out of date and therefore they need to upgrade their own browser?

With JavaScript, you could snoop for the browser features that are not supported and then

Having logged the image with username, you can then trawl the logs for users with outdated browsers.

Embed the JavaScript at the end of the BODY in

Administration | Look and Feel | Custom HTML

1 vote
Raymond Lai
Contributor
June 21, 2011

There is a hack-and-slash method.

We use Google Analytics, and we embedded the javascript inside the "Custom HTML" under the Administration > Look and Feel section.

Advantages:

* Google Analytics does more than record browser usage,

* This solution only requires you to have Confluence administrative rights, and

* You don't need to hack and slash around Apache, so your IT team doesn't even have to know. :)

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 23, 2011
Be sure to remember that Google Analytics does not permit you to "collect personally identifiable information". For more details, check this section from the Analytics Plugins's "Occasionally Asked Questions" page: https://studio.plugins.atlassian.com/wiki/display/CGAP/Occasionally+Asked+Questions#OccasionallyAskedQuestions-CanGoogleAnalyticsalsotrackusernames%3F
Bruce Imhoff June 27, 2011

Unfortunately Google Analytics won't work because we're sitting behind a firewall, but thanks for the suggestion.

0 votes
Andrei [errno]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 21, 2011

we configured Confluence / JIRA to sit behind Apache server acting as a proxy. If you use the same setup - collecting browser info is a trivial task of parsing access logs. (there are quite a few software packages that produce nice graphs (AWStats, for example)

Bruce Imhoff June 27, 2011

Thanks webwesen, we have almost the same configuration, we've got the Apache server passing internet connections through to Confluence / Jira, but also have a F5 configured for intranet connection to the same instance of Confluence and Jira, so I think we really need to configure this on the Tomcat instance that Confluence is running on, otherwise we won't collect all of the internal connections, which make up the majority of users.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events