~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/rgw/rgw_log.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-06-08 15:54:37 UTC
  • mfrom: (1.1.8) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20120608155437-gy3j9k6wzv7w4gn9
Tags: 0.44.1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - d/control: Switch from libcryptopp to libnss as libcryptopp
    is not seeded.
  - d/control,d/rules: Move from python-support to dh_python2.
  - d/patches/manpage_updates*.patch: cherry picked upstream manpage
    updates warning about lack of encryption, per MIR review.
  - d/rules,d/control: Drop radosgw since libfcgi is not in main and
    the code may not be suitable for LTS.
  - d/rules,d/control: Drop tcmalloc since google perftools is not
    in main yet.
  - d/rules,d/control: Drop ceph-fuse entirely per MIR review
    recommendation.
* d/patches/fix-radosgw-tests.patch: Cherry picked patch from upstream
  VCS to fixup tests to conditionally use radosgw if enabled.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
#define DOUT_SUBSYS rgw
9
9
 
 
10
void rgw_log_entry::generate_test_instances(list<rgw_log_entry*>& o)
 
11
{
 
12
  rgw_log_entry *e = new rgw_log_entry;
 
13
  e->object_owner = "object_owner";
 
14
  e->bucket_owner = "bucket_owner";
 
15
  e->bucket = "bucket";
 
16
  e->remote_addr = "1.2.3.4";
 
17
  e->user = "user";
 
18
  e->obj = "obj";
 
19
  e->uri = "http://uri/bucket/obj";
 
20
  e->http_status = "200";
 
21
  e->error_code = "error_code";
 
22
  e->bytes_sent = 1024;
 
23
  e->bytes_received = 512;
 
24
  e->obj_size = 2048;
 
25
  e->user_agent = "user_agent";
 
26
  e->referrer = "referrer";
 
27
  e->bucket_id = 10;
 
28
  o.push_back(e);
 
29
  o.push_back(new rgw_log_entry);
 
30
}
 
31
 
 
32
void rgw_log_entry::dump(Formatter *f) const
 
33
{
 
34
  f->dump_string("object_owner", object_owner);
 
35
  f->dump_string("bucket_owner", bucket_owner);
 
36
  f->dump_string("bucket", bucket);
 
37
  f->dump_stream("time") << time;
 
38
  f->dump_string("remote_addr", remote_addr);
 
39
  f->dump_string("user", user);
 
40
  f->dump_string("obj", obj);
 
41
  f->dump_string("op", op);
 
42
  f->dump_string("uri", uri);
 
43
  f->dump_string("http_status", http_status);
 
44
  f->dump_string("error_code", error_code);
 
45
  f->dump_unsigned("bytes_sent", bytes_sent);
 
46
  f->dump_unsigned("bytes_received", bytes_received);
 
47
  f->dump_unsigned("obj_size", obj_size);
 
48
  f->dump_stream("total_time") << total_time;
 
49
  f->dump_string("user_agent", user_agent);
 
50
  f->dump_string("referrer", referrer);
 
51
  f->dump_unsigned("bucket_id", bucket_id);
 
52
}
 
53
 
 
54
void rgw_intent_log_entry::generate_test_instances(list<rgw_intent_log_entry*>& o)
 
55
{
 
56
  rgw_intent_log_entry *e = new rgw_intent_log_entry;
 
57
  rgw_bucket b("bucket", "pool", "marker", 10);
 
58
  e->obj = rgw_obj(b, "object");
 
59
  e->intent = DEL_OBJ;
 
60
  o.push_back(e);
 
61
  o.push_back(new rgw_intent_log_entry);
 
62
}
 
63
 
 
64
void rgw_intent_log_entry::dump(Formatter *f) const
 
65
{
 
66
  f->open_object_section("obj");
 
67
  obj.dump(f);
 
68
  f->close_section();
 
69
  f->dump_stream("op_time") << op_time;
 
70
  f->dump_unsigned("intent", intent);
 
71
}
 
72
 
10
73
static rgw_bucket log_bucket(RGW_LOG_POOL_NAME);
11
74
 
12
75
static void set_param_str(struct req_state *s, const char *name, string& str)
120
183
  set_param_str(s, "REQUEST_METHOD", entry.op);
121
184
 
122
185
  entry.user = s->user.user_id;
123
 
  if (s->acl)
124
 
    entry.object_owner = s->acl->get_owner().get_id();
 
186
  if (s->object_acl)
 
187
    entry.object_owner = s->object_acl->get_owner().get_id();
125
188
  entry.bucket_owner = s->bucket_owner;
126
189
 
127
190
  entry.time = s->time;